File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -184,9 +184,15 @@ def is_enabled(self):
184
184
return True
185
185
if cmd .stdout .strip () == "disabled" :
186
186
return False
187
- # Fallback on SysV
187
+ # Fallback on SysV - only for non-systemd units
188
188
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=760616
189
- return super ().is_enabled
189
+ if not self ._has_systemd_suffix ():
190
+ return super ().is_enabled
191
+ raise RuntimeError (
192
+ "Unable to determine state of {0}. Does this service exist?" .format (
193
+ self .name
194
+ )
195
+ )
190
196
191
197
@property
192
198
def is_valid (self ):
@@ -290,9 +296,7 @@ def is_enabled(self):
290
296
if self .name in self .check_output ("rcctl ls off" ).splitlines ():
291
297
return False
292
298
raise RuntimeError (
293
- "Unable to determine state of {0}. Does this service exist?" .format (
294
- self .name
295
- )
299
+ f"Unable to determine state of { self .name } . Does this service exist?"
296
300
)
297
301
298
302
You can’t perform that action at this time.
0 commit comments