Skip to content

Commit 370491b

Browse files
dorianmphilpep
authored andcommitted
Service: Add is_valid and is_masked to Service class
Added in the Service parent class to generate the documentation.
1 parent 3a027cc commit 370491b

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

testinfra/modules/service.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,24 @@ def is_enabled(self):
4242
"""Test if service is enabled"""
4343
raise NotImplementedError
4444

45+
@property
46+
def is_valid(self):
47+
"""Test if service is valid
48+
49+
This method is only available in the systemd implementation,
50+
it will raise NotImplementedError in others implementation
51+
"""
52+
raise NotImplementedError
53+
54+
@property
55+
def is_masked(self):
56+
"""Test if service is masked
57+
58+
This method is only available in the systemd implementation,
59+
it will raise NotImplementedError in others implementations
60+
"""
61+
raise NotImplementedError
62+
4563
@classmethod
4664
def get_module_class(cls, host):
4765
if host.system_info.type == "linux":

0 commit comments

Comments
 (0)