small cleanup

This commit is contained in:
Bruce Leidl 2019-01-30 21:43:55 -05:00
parent 2dc32d1f20
commit d3ac4bb000
2 changed files with 4 additions and 13 deletions

View File

@ -6,13 +6,8 @@ lazy_static! {
pub static ref GLOBAL_CONFIG: RealmConfig = RealmConfig::load_global_config(); pub static ref GLOBAL_CONFIG: RealmConfig = RealmConfig::load_global_config();
} }
fn default_zone() -> String { const DEFAULT_ZONE: &str = "clear";
"clear".to_owned() const DEFAULT_REALMFS: &str = "base";
}
fn default_realmfs() -> String {
"base".to_owned()
}
#[derive (Deserialize,Clone)] #[derive (Deserialize,Clone)]
pub struct RealmConfig { pub struct RealmConfig {
@ -90,8 +85,8 @@ impl RealmConfig {
use_kvm: Some(false), use_kvm: Some(false),
use_gpu: Some(false), use_gpu: Some(false),
use_network: Some(true), use_network: Some(true),
network_zone: Some(default_zone()), network_zone: Some(DEFAULT_ZONE.into()),
realmfs: Some(default_realmfs()), realmfs: Some(DEFAULT_REALMFS.into()),
realmfs_write: Some(false), realmfs_write: Some(false),
parent: None, parent: None,
} }
@ -153,7 +148,6 @@ impl RealmConfig {
} }
} }
"" ""
} }
fn bool_value<F>(&self, get: F) -> bool fn bool_value<F>(&self, get: F) -> bool
@ -167,6 +161,5 @@ impl RealmConfig {
return get(parent).unwrap_or(false); return get(parent).unwrap_or(false);
} }
false false
} }
} }

View File

@ -35,8 +35,6 @@ mod systemd;
mod config; mod config;
mod network; mod network;
use libcitadel::RealmFS;
use crate::realm::{Realm,RealmSymlinks}; use crate::realm::{Realm,RealmSymlinks};
use crate::manager::RealmManager; use crate::manager::RealmManager;
use crate::config::RealmConfig; use crate::config::RealmConfig;