summaryrefslogtreecommitdiffstats
path: root/src/lib/Client/Tools/RcUpdate.py
diff options
context:
space:
mode:
authorSol Jerome <solj@ices.utexas.edu>2009-04-24 22:35:03 +0000
committerSol Jerome <solj@ices.utexas.edu>2009-04-24 22:35:03 +0000
commit7f3820bc79d27bc7e19b73658d6f0cfaa5b3b53a (patch)
tree1f38a9fb89d70cb158478661cdcb2cbda098ce5f /src/lib/Client/Tools/RcUpdate.py
parentf8b1a55d842f2beef4823b825552ff440b80c655 (diff)
downloadbcfg2-7f3820bc79d27bc7e19b73658d6f0cfaa5b3b53a.tar.gz
bcfg2-7f3820bc79d27bc7e19b73658d6f0cfaa5b3b53a.tar.bz2
bcfg2-7f3820bc79d27bc7e19b73658d6f0cfaa5b3b53a.zip
Python 2to3 updates for the Client tools
Signed-off-by: Sol Jerome <solj@ices.utexas.edu> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5178 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Client/Tools/RcUpdate.py')
-rw-r--r--src/lib/Client/Tools/RcUpdate.py22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/lib/Client/Tools/RcUpdate.py b/src/lib/Client/Tools/RcUpdate.py
index c230544fe..88423925b 100644
--- a/src/lib/Client/Tools/RcUpdate.py
+++ b/src/lib/Client/Tools/RcUpdate.py
@@ -1,7 +1,9 @@
'''This is rc-update support'''
-__revision__ = '$Revision$'
+__revision__ = '$Revision: 4991 $'
-import Bcfg2.Client.Tools, Bcfg2.Client.XML, commands, os
+import os
+import Bcfg2.Client.Tools
+import Bcfg2.Client.XML
class RcUpdate(Bcfg2.Client.Tools.SvcTool):
'''RcUpdate support for Bcfg2'''
@@ -15,17 +17,9 @@ class RcUpdate(Bcfg2.Client.Tools.SvcTool):
Verify Service status for entry.
Assumes we run in the "default" runlevel.
'''
- # mrj - i think this should be:
- # rc = self.cmd.run('/bin/rc-status | \
- # grep %s | \
- # grep started"' % entry.attrib['name'])
- #
- # ...but as i can't figure out a way to
- # test that right now, i'll do the one
- # that works in python's interactive interpreter.
- rc = commands.getoutput('/bin/rc-status -s | grep %s | grep started' % \
- entry.get('name'))
- status = len(rc) > 0
+ rc, output = self.cmd.run('/bin/rc-status | grep %s | grep started' % \
+ entry.attrib['name'])
+ status = rc > 0
if not status:
# service is off
@@ -59,7 +53,7 @@ class RcUpdate(Bcfg2.Client.Tools.SvcTool):
def FindExtra(self):
'''Locate extra rc-update Services'''
allsrv = [line.split()[0] for line in \
- self.cmd.run("/bin/rc-status -s | grep started")[1]]
+ self.cmd.run("/bin/rc-status | grep started")[1]]
self.logger.debug('Found active services:')
self.logger.debug(allsrv)
specified = [srv.get('name') for srv in self.getSupportedEntries()]