summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2005-01-20 22:46:14 +0000
committerNarayan Desai <desai@mcs.anl.gov>2005-01-20 22:46:14 +0000
commit98c23c0048061c0a9986bd1c9034882c5f55eadd (patch)
tree5d720a2a51537b021358ff7e6f7f74292983c8a2 /src
parentf406ee7c53c12eadf3122dbfbfddc92119237f0a (diff)
downloadbcfg2-98c23c0048061c0a9986bd1c9034882c5f55eadd.tar.gz
bcfg2-98c23c0048061c0a9986bd1c9034882c5f55eadd.tar.bz2
bcfg2-98c23c0048061c0a9986bd1c9034882c5f55eadd.zip
add simplefile option
2005/01/19 13:15:05-06:00 anl.gov!desai fix variable (Logical change 1.193) git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@824 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src')
-rw-r--r--src/lib/Server/Generators/Pkgmgr.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lib/Server/Generators/Pkgmgr.py b/src/lib/Server/Generators/Pkgmgr.py
index eb560b0a4..ae82dc5d1 100644
--- a/src/lib/Server/Generators/Pkgmgr.py
+++ b/src/lib/Server/Generators/Pkgmgr.py
@@ -1,6 +1,7 @@
'''This module implements a package management scheme for all images'''
__revision__ = '$Revision$'
+from copy import deepcopy
from re import compile as regcompile
from syslog import syslog, LOG_ERR
@@ -17,7 +18,11 @@ class PackageEntry(XMLFileBacked):
self.packages = {}
for location in self.entries:
for pkg in location.getchildren():
- if pkg.attrib.has_key("file"):
+ if pkg.attrib.has_key("simplefile"):
+ self.packages[pkg.get('name')] = deepcopy(pkg.attrib)
+ # most attribs will be set from pkg
+ self.packages[pkg.get('name')]['uri'] = location.attrib['uri']
+ elif pkg.attrib.has_key("file"):
mdata = self.rpm.match(pkg.get('file'))
if not mdata:
print "failed to rpm match %s" % (pkg.get('file'))
@@ -62,7 +67,7 @@ class Pkgmgr(Generator):
if pkglist.packages.has_key(pkgname):
entry.attrib.update(pkglist.packages[pkgname])
return
- elif not self.pkgdir.has_key("%s.xml" % metadata.image):
+ elif not self.pkgdir.entries.has_key("%s.xml" % metadata.image):
syslog(LOG_ERR, "Pkgmgr: no package index for image %s" % metadata.image)
raise GeneratorError, ("Image", metadata.image)
pkglist = self.pkgdir["%s.xml" % (metadata.image)]