Compare commits

..

No commits in common. "1578216712c7e13a32ea9d5795649c2d9ce42478" and "4fb35330749493dfaa610e03ec7fb5032364f185" have entirely different histories.

2 changed files with 5 additions and 15 deletions

View File

@ -51,10 +51,7 @@ fn load_processes(json_filename: &str) -> Option<Processes> {
pub async fn get_actual_config(params : Arc<PrebootParams>) -> Option<Processes> {
// * if no local conf -> loop and +inf getting conf from redis server
// * if local conf -> once getting conf from redis server
let config_path = params.config.to_str().unwrap_or_else(|| {
error!("Invalid character in config file. Config path was set to default");
"settings.json"
});
let config_path = params.config.to_str()?;
info!("Configurating config module with params: no-remote-config={}, no-sub={}, local config path={:?}, remote server={}", params.no_remote_config, params.no_sub, params.config, params.remote_server_url);
match load_processes(config_path) {
Some(local_conf) => {

View File

@ -102,26 +102,19 @@ pub struct PrebootParams {
}
impl PrebootParams {
pub fn validate(mut self) -> Result<Self> {
pub fn validate(self) -> Result<Self> {
if !self.socket_path.exists() && !self.no_hostagent {
eprintln!("Error: Socket-file not found or Noxis can't read it. Socket-file was set to default");
self.socket_path = PathBuf::from("/var/run/enode/hostagent.sock");
// return Err(Error::msg("Socket-file not found or Noxis can't read it. Cannot start"));
return Err(Error::msg("Socket-file not found or Noxis can't read it. Cannot start"));
}
// existing log dir
if !self.log_to.exists() && !self.no_logs {
eprintln!("Error: LogDir not found or Noxis can't read it. LogDir was set to default");
self.log_to = PathBuf::from("./");
// return Err(Error::msg("Log Directory Not Found or Noxis can't read it. Cannot start"));
return Err(Error::msg("Log Directory Not Found or Noxis can't read it. Cannot start"));
}
// existing sock file
if !self.config.exists() {
eprintln!("Error: Invalid character in config file. Config path was set to default");
self.config = PathBuf::from("settings.json");
// return Err(Error::msg("Local Config Not Found or Noxis can't read it. Cannot start"));
return Err(Error::msg("Local Config Not Found or Noxis can't read it. Cannot start"));
}
// redis server check
dbg!(&self);
Ok(self)
}
}