mirror of
https://gitlab.steamos.cloud/holo/steamos-manager.git
synced 2025-07-05 06:00:30 -04:00
systemd: Fix SystemdUnit::exists
This commit is contained in:
parent
1d55b0d828
commit
bbd62df54b
1 changed files with 5 additions and 0 deletions
|
@ -94,6 +94,11 @@ impl<'dbus> SystemdUnit<'dbus> {
|
|||
let expected_error = format!("Unit {name} not loaded.");
|
||||
match manager.get_unit(name).await {
|
||||
Ok(_) => Ok(true),
|
||||
Err(zbus::Error::MethodError(name, _, _))
|
||||
if name == "org.freedesktop.systemd1.NoSuchUnit" =>
|
||||
{
|
||||
Ok(false)
|
||||
}
|
||||
Err(zbus::Error::Failure(message)) if message == expected_error => Ok(false),
|
||||
Err(e) => Err(e.into()),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue