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
2008-01-11 10:36:25 +00:00
parent bfb4564f9d
commit 9161dcbbdc
2 changed files with 26 additions and 1 deletions

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]