mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2026-11-03 12:47:03 -06:00
Co-Authored-By: trendal
Applies Trendal's fixes for using the correct config location. Thanks!
This commit is contained in:
1 parent
7f54c13eff
commit
6f3ab4a255
2 files changed
+3
-3
No files matched your search
@@ -24,10 +24,10 @@ pub enum MigrationError {
|
||||
PythonLoadError(#[from] PythonMigrationError),
|
||||
}
|
||||
|
||||
pub fn migrate_if_needed() -> Result<(), MigrationError> {
|
||||
pub fn migrate_if_needed(config_location: &str) -> Result<(), MigrationError> {
|
||||
debug!("Checking config file version");
|
||||
let raw =
|
||||
std::fs::read_to_string("/etc/lqos.conf").map_err(|e| MigrationError::ReadError(e))?;
|
||||
std::fs::read_to_string(&config_location).map_err(|e| MigrationError::ReadError(e))?;
|
||||
|
||||
let doc = raw
|
||||
.parse::<DocumentMut>()
|
||||
|
||||
@@ -52,7 +52,7 @@ pub fn load_config() -> Result<Arc<Config>, LibreQoSConfigError> {
|
||||
};
|
||||
|
||||
debug!("Loading configuration file {config_location}");
|
||||
migrate_if_needed().map_err(|e| {
|
||||
migrate_if_needed(&config_location).map_err(|e| {
|
||||
error!("Unable to migrate configuration: {:?}", e);
|
||||
LibreQoSConfigError::FileNotFoud
|
||||
})?;
|
||||
|
||||
Reference in new issue
Block a user