summaryrefslogtreecommitdiffstats
path: root/src/lib/Client
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2009-10-16 02:01:09 +0000
committerNarayan Desai <desai@mcs.anl.gov>2009-10-16 02:01:09 +0000
commitb6da95ace6dcc8b5ff5b56ae17dc5804e3328d8e (patch)
treee459784cf0a68f78b168bf849abe2a5a0f6c079d /src/lib/Client
parent3f4cfa355f9f3c20a1c9dd13bd224416995be100 (diff)
downloadbcfg2-b6da95ace6dcc8b5ff5b56ae17dc5804e3328d8e.tar.gz
bcfg2-b6da95ace6dcc8b5ff5b56ae17dc5804e3328d8e.tar.bz2
bcfg2-b6da95ace6dcc8b5ff5b56ae17dc5804e3328d8e.zip
SYSV fixes: (Resolves Ticket #762) (Patch from ITS Systems Team)
- Flush noaskfile changes to disk - Handle package names better git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5483 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Client')
-rw-r--r--src/lib/Client/Tools/SYSV.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/Client/Tools/SYSV.py b/src/lib/Client/Tools/SYSV.py
index 146ce7967..8a9af9645 100644
--- a/src/lib/Client/Tools/SYSV.py
+++ b/src/lib/Client/Tools/SYSV.py
@@ -31,10 +31,13 @@ class SYSV(Bcfg2.Client.Tools.PkgTool):
def __init__(self, logger, setup, config):
Bcfg2.Client.Tools.PkgTool.__init__(self, logger, setup, config)
+ # noaskfile needs to live beyond __init__ otherwise file is removed
self.noaskfile = tempfile.NamedTemporaryFile()
self.noaskname = self.noaskfile.name
try:
self.noaskfile.write(noask)
+ # flush admin file contents to disk
+ self.noaskfile.flush()
self.pkgtool = (self.pkgtool[0] % ("-a %s" % (self.noaskname)), \
self.pkgtool[1])
except:
@@ -46,7 +49,12 @@ class SYSV(Bcfg2.Client.Tools.PkgTool):
# Build list of packages
lines = self.cmd.run("/usr/bin/pkginfo -x")[1]
while lines:
- version = lines.pop().split()[1]
+ # Splitting on whitespace means that packages with spaces in
+ # their version numbers don't work right. Found this with
+ # IBM TSM software with package versions like
+ # "Version 6 Release 1 Level 0.0"
+ # Should probably be done with a regex but this works.
+ version = lines.pop().split(') ')[1]
pkg = lines.pop().split()[0]
self.installed[pkg] = version