remove _sec postfix as theyre not seconds
continuous-integration/drone/push Build is passing Details

master
eater 5 years ago
parent fa1e398f0a
commit a1ebd63a7b
Signed by: eater
GPG Key ID: AD2560A0F84F0759

@ -11,8 +11,6 @@ pub struct Unit {
name: String, name: String,
state: UnitState, state: UnitState,
description: String, description: String,
// Space only
documentation: Vec<String>, documentation: Vec<String>,
// Space -and- list // Space -and- list
@ -39,7 +37,6 @@ pub struct Unit {
requires_mounts_for: Vec<String>, requires_mounts_for: Vec<String>,
on_failure_job_mode: JobMode, on_failure_job_mode: JobMode,
ignore_on_isolate: bool, ignore_on_isolate: bool,
stop_when_unneeded: bool, stop_when_unneeded: bool,
refuse_manual_start: bool, refuse_manual_start: bool,
@ -51,11 +48,11 @@ pub struct Unit {
success_action: UnitAction, success_action: UnitAction,
failure_action_exit_status: Option<u8>, failure_action_exit_status: Option<u8>,
success_action_exit_status: Option<u8>, success_action_exit_status: Option<u8>,
job_timeout_sec: TimeSpan, job_timeout: TimeSpan,
job_running_timeout_sec: TimeSpan, job_running_timeout: TimeSpan,
job_timeout_action: UnitAction, job_timeout_action: UnitAction,
job_timeout_reboot_argument: Option<String>, job_timeout_reboot_argument: Option<String>,
start_limit_interval_sec: FiniteTimeSpan, start_limit_interval: FiniteTimeSpan,
start_limit_burst: usize, start_limit_burst: usize,
start_limit_action: UnitAction, start_limit_action: UnitAction,
reboot_argument: Option<String>, reboot_argument: Option<String>,
@ -190,13 +187,13 @@ impl Unit {
.and_then(|x| x.parse::<u8>().ok()) .and_then(|x| x.parse::<u8>().ok())
.or(unit.success_action_exit_status); .or(unit.success_action_exit_status);
unit.job_timeout_sec = section unit.job_timeout = section
.get_time_span("JobTimeoutSec") .get_time_span("JobTimeoutSec")
.unwrap_or(unit.job_timeout_sec); .unwrap_or(unit.job_timeout);
unit.job_running_timeout_sec = section unit.job_running_timeout = section
.get_time_span("JobRunningTimeoutSec") .get_time_span("JobRunningTimeoutSec")
.unwrap_or(unit.job_running_timeout_sec); .unwrap_or(unit.job_running_timeout);
unit.job_timeout_action = section unit.job_timeout_action = section
.get_string("JobTimeoutAction") .get_string("JobTimeoutAction")
@ -207,9 +204,9 @@ impl Unit {
.get_string("JobTimeoutRebootArgument") .get_string("JobTimeoutRebootArgument")
.map(str::to_string); .map(str::to_string);
unit.start_limit_interval_sec = section unit.start_limit_interval = section
.get_finite_time_span("StartLimitIntervalSec") .get_finite_time_span("StartLimitIntervalSec")
.unwrap_or(unit.start_limit_interval_sec); .unwrap_or(unit.start_limit_interval);
unit.start_limit_burst = section unit.start_limit_burst = section
.get_string("StartLimitBurst") .get_string("StartLimitBurst")
@ -275,11 +272,11 @@ impl Default for Unit {
success_action: UnitAction::None, success_action: UnitAction::None,
failure_action_exit_status: None, failure_action_exit_status: None,
success_action_exit_status: None, success_action_exit_status: None,
job_timeout_sec: Infinite, job_timeout: Infinite,
job_running_timeout_sec: Infinite, job_running_timeout: Infinite,
job_timeout_action: UnitAction::None, job_timeout_action: UnitAction::None,
job_timeout_reboot_argument: None, job_timeout_reboot_argument: None,
start_limit_interval_sec: Default::default(), start_limit_interval: Default::default(),
start_limit_burst: 0, start_limit_burst: 0,
start_limit_action: UnitAction::None, start_limit_action: UnitAction::None,
reboot_argument: None, reboot_argument: None,
@ -406,6 +403,5 @@ SuccessActionExitStatus=256
assert_eq!(unit.collect_mode, CollectMode::InactiveOrFailed); assert_eq!(unit.collect_mode, CollectMode::InactiveOrFailed);
assert_eq!(unit.success_action_exit_status, None); assert_eq!(unit.success_action_exit_status, None);
assert_eq!(unit.failure_action_exit_status, Some(1)); assert_eq!(unit.failure_action_exit_status, Some(1));
} }
} }
Loading…
Cancel
Save