diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2013-03-24 04:51:44 -0400 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2013-03-24 04:51:44 -0400 |
commit | 6987584150cb9bcc8b178f1e714339f74669345b (patch) | |
tree | aadc07bf59671eceda565517a8b737e6305ce2ef /src/lib/Bcfg2/Client/Tools/RcUpdate.py | |
parent | c9ba92ef62376bbf01da1eac96cd5a2b5eb65a66 (diff) | |
parent | 4d6c2efbe2df7b516ef0dfcdaf2614adaa3fb53e (diff) | |
download | bcfg2-6987584150cb9bcc8b178f1e714339f74669345b.tar.gz bcfg2-6987584150cb9bcc8b178f1e714339f74669345b.tar.bz2 bcfg2-6987584150cb9bcc8b178f1e714339f74669345b.zip |
Merge branch 'maint'
Diffstat (limited to 'src/lib/Bcfg2/Client/Tools/RcUpdate.py')
-rw-r--r-- | src/lib/Bcfg2/Client/Tools/RcUpdate.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/Bcfg2/Client/Tools/RcUpdate.py b/src/lib/Bcfg2/Client/Tools/RcUpdate.py index 2e58f2564..552b27842 100644 --- a/src/lib/Bcfg2/Client/Tools/RcUpdate.py +++ b/src/lib/Bcfg2/Client/Tools/RcUpdate.py @@ -22,8 +22,8 @@ class RcUpdate(Bcfg2.Client.Tools.SvcTool): return True # check if service is enabled - cmd = '/sbin/rc-update show default | grep %s' - is_enabled = self.cmd.run(cmd % entry.get('name')).success + result = self.cmd.run(["/sbin/rc-update", "show", "default"]) + is_enabled = entry.get("name") in result.stdout # check if init script exists try: @@ -34,8 +34,8 @@ class RcUpdate(Bcfg2.Client.Tools.SvcTool): return False # check if service is enabled - cmd = '/etc/init.d/%s status | grep started' - is_running = self.cmd.run(cmd % entry.attrib['name']).success + result = self.cmd.run(self.get_svc_command(entry, "status")) + is_running = "started" in result.stdout if entry.get('status') == 'on' and not (is_enabled and is_running): entry.set('current_status', 'off') @@ -70,9 +70,9 @@ class RcUpdate(Bcfg2.Client.Tools.SvcTool): def FindExtra(self): """Locate extra rc-update services.""" - cmd = '/bin/rc-status -s' allsrv = [line.split()[0] - for line in self.cmd.run(cmd).stdout.splitlines() + for line in self.cmd.run(['/bin/rc-status', + '-s']).stdout.splitlines() if 'started' in line] self.logger.debug('Found active services:') self.logger.debug(allsrv) |