Name update
This commit is contained in:
@@ -48,9 +48,9 @@ pub struct Settings {
|
||||
pub default_local_hdd: bool,
|
||||
|
||||
/// When a client hits the Queued Deployment item, how long (seconds) to
|
||||
/// hold it at the gate before giving up and falling back to the menu.
|
||||
/// hold it in queue before giving up and falling back to the menu.
|
||||
/// 0 = forever.
|
||||
pub gate_wait_max_secs: u32,
|
||||
pub queue_wait_max_secs: u32,
|
||||
|
||||
/// Optional DNS server advertised on the Network tab. Purely
|
||||
/// informational today — OpenPXE does not run a DNS server, but
|
||||
@@ -67,11 +67,8 @@ pub enum TimeoutAction {
|
||||
/// Chain the "Boot from Local HDD" entry.
|
||||
LocalHdd,
|
||||
/// Put the client into the deployment queue, waiting for operator
|
||||
/// assignment. The serde alias keeps v0.2.0 settings.json files
|
||||
/// readable after the v0.3.0 rename — old `"gated_deployment"`
|
||||
/// values deserialize transparently.
|
||||
/// assignment.
|
||||
#[default]
|
||||
#[serde(alias = "gated_deployment")]
|
||||
QueuedDeployment,
|
||||
}
|
||||
|
||||
@@ -84,7 +81,7 @@ impl Default for Settings {
|
||||
smb_host_override: String::new(),
|
||||
extra_kernel_args: String::new(),
|
||||
default_local_hdd: true,
|
||||
gate_wait_max_secs: 0,
|
||||
queue_wait_max_secs: 0,
|
||||
dns_server: String::new(),
|
||||
}
|
||||
}
|
||||
@@ -115,7 +112,10 @@ impl SettingsStore {
|
||||
},
|
||||
Err(_) => Settings::default(),
|
||||
};
|
||||
Arc::new(Self { path, inner: RwLock::new(initial) })
|
||||
Arc::new(Self {
|
||||
path,
|
||||
inner: RwLock::new(initial),
|
||||
})
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
@@ -181,6 +181,12 @@ mod tests {
|
||||
assert!(s.windows_enabled);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn settings_serialize_queue_naming() {
|
||||
let text = serde_json::to_string(&Settings::default()).unwrap();
|
||||
assert!(text.contains("queue_wait_max_secs"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn corrupt_file_falls_back_to_default() {
|
||||
let dir = tempdir().unwrap();
|
||||
|
||||
Reference in New Issue
Block a user