diff options
| author | Robert Günzler <r@gnzler.io> | 2025-09-07 17:32:13 +0200 |
|---|---|---|
| committer | Robert Günzler <r@gnzler.io> | 2025-09-25 13:16:28 +0200 |
| commit | 9932b0d7c5167215c0cca219e9b919218b9d2dfa (patch) | |
| tree | 8b32ab0748ca26ac3f3a11fb472fb5ee671e2da8 /items | |
| parent | 99e5cfd96016c2816affda1ceba50e2673ba42fc (diff) | |
svc_openrc2: sync to upstream
Signed-off-by: Robert Günzler <r@gnzler.io>
Diffstat (limited to 'items')
| -rw-r--r-- | items/svc_openrc2.py | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/items/svc_openrc2.py b/items/svc_openrc2.py index 5b74f61..2ea419c 100644 --- a/items/svc_openrc2.py +++ b/items/svc_openrc2.py @@ -24,8 +24,7 @@ def svc_enable(node, svcname, runlevel): def svc_enabled(node, svcname, runlevel): result = node.run( - f"rc-update show {quote(runlevel)} | grep -w {quote(svcname)}", - may_fail=True, + f"rc-update show {quote(runlevel)} | grep -w {quote(svcname)}", may_fail=True ) return result.return_code == 0 and svcname in result.stdout_text @@ -57,10 +56,7 @@ class SvcOpenRC2(Item): def __repr__(self): return "<SvcOpenRC name:{} runlevel:{} enabled:{} running:{}>".format( - self.name, - self.attributes["runlevel"], - self.attributes["enabled"], - self.attributes["running"], + self.name, self.attributes["runlevel"], self.attributes["enabled"], self.attributes["running"], ) def fix(self, status): @@ -77,8 +73,8 @@ class SvcOpenRC2(Item): svc_stop(self.node, self.name) if "runlevel" in status.keys_to_fix: - if status.sdict["runlevel"]: - svc_disable(self.node, self.name, status.sdict["runlevel"]) + if status.sdict.runlevel: + svc_disable(self.node, self.name, status.sdict.runlevel) svc_enable(self.node, self.name, self.attributes["runlevel"]) def get_canned_actions(self): @@ -119,8 +115,6 @@ class SvcOpenRC2(Item): _( "expected boolean or None for '{attribute}' on {item} in bundle '{bundle}'" ).format( - attribute=attribute, - bundle=bundle.name, - item=item_id, + attribute=attribute, bundle=bundle.name, item=item_id, ) ) |