summaryrefslogtreecommitdiffstats
path: root/src/lib/Client
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2005-09-16 15:52:56 +0000
committerNarayan Desai <desai@mcs.anl.gov>2005-09-16 15:52:56 +0000
commit4f5f13afe4f7732582f9c1d407b26fee906afc96 (patch)
treeab442278ffd967187115a702082e3c23bbe2dc81 /src/lib/Client
parente95757e0aa5a51ac961583532a3a639d3866bfd6 (diff)
downloadbcfg2-4f5f13afe4f7732582f9c1d407b26fee906afc96.tar.gz
bcfg2-4f5f13afe4f7732582f9c1d407b26fee906afc96.tar.bz2
bcfg2-4f5f13afe4f7732582f9c1d407b26fee906afc96.zip
get solaris changes all working
2005/09/15 13:27:36-05:00 anl.gov!desai make unbound configfiles return a reasonable error message, not a traceback (Logical change 1.316) git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@1293 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Client')
-rw-r--r--src/lib/Client/Toolset.py20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/lib/Client/Toolset.py b/src/lib/Client/Toolset.py
index 0e5f513e2..9f759d733 100644
--- a/src/lib/Client/Toolset.py
+++ b/src/lib/Client/Toolset.py
@@ -329,6 +329,10 @@ class Toolset(object):
def InstallConfigFile(self, entry):
'''Install ConfigFile Entry'''
+ if entry.text == None:
+ self.CondPrint('verbose',
+ "Incomplete information for ConfigFile %s. Cannot install" % (entry.get('name')))
+ return False
self.CondPrint('verbose', "Installing ConfigFile %s" % (entry.get('name')))
if self.setup['dryrun']:
@@ -497,8 +501,9 @@ class Toolset(object):
packages = [pkg for pkg in work if pkg.tag == 'Package']
ptypes = []
- [ptypes.append(ptype) for ptype in [pkg.get('type') for pkg in packages]
- if pkg.get('type') not in ptypes]
+ for pkg in packages:
+ if pkg.get('type') not in ptypes:
+ ptypes.append(pkg.get('type'))
if packages:
for pkgtype in ptypes:
# try single large install
@@ -508,9 +513,16 @@ class Toolset(object):
continue
pkgtool = self.pkgtool[pkgtype]
pkglist = [pkg for pkg in packages if pkg.get('type') == pkgtype]
- pkgargs = " ".join([pkgtool[1][0] % tuple([pkg.get(field, '') for field in pkgtool[1][1]])
+ for field in pkgtool[1][1]:
+ pkglist = [pkg for pkg in pkglist if pkg.attrib.has_key(field)]
+ if not pkglist:
+ self.CondPrint("debug", "No complete/installable packages of type %s" % pkgtype)
+ continue
+ pkgargs = " ".join([pkgtool[1][0] % tuple([pkg.get(field) for field in pkgtool[1][1]])
for pkg in pkglist])
- self.CondPrint("debug", "Installing packages: %s" % pkgargs)
+
+ self.CondPrint("debug", "Installing packages: :%s:" % pkgargs)
+ self.CondPrint("debug", "Running command ::%s::" % (pkgtool[0] % pkgargs))
cmdrc = system(pkgtool[0] % pkgargs)
if cmdrc == 0: