Add service.is_enabled() helper

Add a simple helper to check whether a service is enabled.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
This commit is contained in:
Mark McLoughlin committed 2008-01-11 10:36:25 +00:00
1 parent bfb4564f9d
commit 9161dcbbdc
2 files changed
+26 -1

No files matched your search

+2
View File
@@ -83,6 +83,8 @@ def run(args, stdin=None):
if p.returncode != 0:
raise CalledProcessError(p.returncode, ' '.join(args))
return (stdout, stderr)
def file_exists(filename):
try:
mode = os.stat(filename)[stat.ST_MODE]