Co-Authored-By: trendal

Applies Trendal's fixes for using the correct config location. Thanks!
This commit is contained in:
Herbert Wolversonandtrendal committed 2025-04-18 14:39:48 -05:00
1 parent 7f54c13eff
commit 6f3ab4a255
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -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>()
+1 -1
View File
@@ -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
})?;