Compare commits
No commits in common. "1578216712c7e13a32ea9d5795649c2d9ce42478" and "4fb35330749493dfaa610e03ec7fb5032364f185" have entirely different histories.
1578216712
...
4fb3533074
|
|
@ -51,10 +51,7 @@ fn load_processes(json_filename: &str) -> Option<Processes> {
|
||||||
pub async fn get_actual_config(params : Arc<PrebootParams>) -> 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 no local conf -> loop and +inf getting conf from redis server
|
||||||
// * if local conf -> once getting conf from redis server
|
// * if local conf -> once getting conf from redis server
|
||||||
let config_path = params.config.to_str().unwrap_or_else(|| {
|
let config_path = params.config.to_str()?;
|
||||||
error!("Invalid character in config file. Config path was set to default");
|
|
||||||
"settings.json"
|
|
||||||
});
|
|
||||||
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);
|
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) {
|
match load_processes(config_path) {
|
||||||
Some(local_conf) => {
|
Some(local_conf) => {
|
||||||
|
|
|
||||||
|
|
@ -102,26 +102,19 @@ pub struct PrebootParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PrebootParams {
|
impl PrebootParams {
|
||||||
pub fn validate(mut self) -> Result<Self> {
|
pub fn validate(self) -> Result<Self> {
|
||||||
if !self.socket_path.exists() && !self.no_hostagent {
|
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");
|
return Err(Error::msg("Socket-file not found or Noxis can't read it. Cannot start"));
|
||||||
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"));
|
|
||||||
}
|
}
|
||||||
// existing log dir
|
// existing log dir
|
||||||
if !self.log_to.exists() && !self.no_logs {
|
if !self.log_to.exists() && !self.no_logs {
|
||||||
eprintln!("Error: LogDir not found or Noxis can't read it. LogDir was set to default");
|
return Err(Error::msg("Log Directory Not Found or Noxis can't read it. Cannot start"));
|
||||||
self.log_to = PathBuf::from("./");
|
|
||||||
// return Err(Error::msg("Log Directory Not Found or Noxis can't read it. Cannot start"));
|
|
||||||
}
|
}
|
||||||
// existing sock file
|
// existing sock file
|
||||||
if !self.config.exists() {
|
if !self.config.exists() {
|
||||||
eprintln!("Error: Invalid character in config file. Config path was set to default");
|
return Err(Error::msg("Local Config Not Found or Noxis can't read it. Cannot start"));
|
||||||
self.config = PathBuf::from("settings.json");
|
|
||||||
// return Err(Error::msg("Local Config Not Found or Noxis can't read it. Cannot start"));
|
|
||||||
}
|
}
|
||||||
// redis server check
|
// redis server check
|
||||||
dbg!(&self);
|
|
||||||
Ok(self)
|
Ok(self)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue