systemd: hm-module systemd.machines option + warn on fetch failures
This commit is contained in:
parent
dfa3840d97
commit
628ae67b7d
2 changed files with 31 additions and 3 deletions
|
|
@ -486,8 +486,12 @@ impl qobject::SystemdService {
|
|||
local_container_names
|
||||
.iter()
|
||||
.map(|(name, _, _)| {
|
||||
fetch_via_busctl(name, &["--machine", name], false, "")
|
||||
.unwrap_or_else(|(k, r)| MachineJson::errored(name.clone(), k, r, 0))
|
||||
fetch_via_busctl(name, &["--machine", name], false, "").unwrap_or_else(
|
||||
|(k, r)| {
|
||||
tracing::warn!(target: "nova_plugin::systemd", machine = %name, kind = k, error = %r, "local container fetch failed");
|
||||
MachineJson::errored(name.clone(), k, r, 0)
|
||||
},
|
||||
)
|
||||
})
|
||||
.collect()
|
||||
} else {
|
||||
|
|
@ -555,12 +559,16 @@ impl qobject::SystemdService {
|
|||
false,
|
||||
"",
|
||||
)
|
||||
.unwrap_or_else(|(k, r)| MachineJson::errored(cn.clone(), k, r, 0))
|
||||
.unwrap_or_else(|(k, r)| {
|
||||
tracing::warn!(target: "nova_plugin::systemd", host = %target, machine = %cn, kind = k, error = %r, "remote container fetch failed");
|
||||
MachineJson::errored(cn.clone(), k, r, 0)
|
||||
})
|
||||
})
|
||||
.collect();
|
||||
m
|
||||
}
|
||||
Err((kind, reason)) => {
|
||||
tracing::warn!(target: "nova_plugin::systemd", host = %target, kind = kind, error = %reason, "remote host fetch failed");
|
||||
MachineJson::errored(target.clone(), kind, reason, prev_last_seen)
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue