summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2005-11-28 20:18:16 +0000
committerNarayan Desai <desai@mcs.anl.gov>2005-11-28 20:18:16 +0000
commitc1e900f9f4b4917e63ddc6446043ad9af74cf2f4 (patch)
tree839f089ca728541c3a2ddf9c12388f5824ab3a53 /src
parenta99e5b2182d2026c12fa89ad5975fa04fe754926 (diff)
downloadbcfg2-c1e900f9f4b4917e63ddc6446043ad9af74cf2f4.tar.gz
bcfg2-c1e900f9f4b4917e63ddc6446043ad9af74cf2f4.tar.bz2
bcfg2-c1e900f9f4b4917e63ddc6446043ad9af74cf2f4.zip
work around stupid lxml bug
(Logical change 1.367) git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@1543 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src')
-rw-r--r--src/lib/Server/Plugins/Pkgmgr.py6
-rw-r--r--src/lib/Server/Plugins/SSHbase.py13
2 files changed, 12 insertions, 7 deletions
diff --git a/src/lib/Server/Plugins/Pkgmgr.py b/src/lib/Server/Plugins/Pkgmgr.py
index 8ee74dd68..f3b3aa144 100644
--- a/src/lib/Server/Plugins/Pkgmgr.py
+++ b/src/lib/Server/Plugins/Pkgmgr.py
@@ -83,13 +83,15 @@ class Pkgmgr(Plugin):
if self.pkgdir.entries.has_key("%s.xml" % metadata.hostname):
pkglist = self.pkgdir["%s.xml" % metadata.hostname]
if pkglist.packages.has_key(pkgname):
- entry.attrib.update(pkglist.packages[pkgname])
+ pkginfo = pkglist.packages[pkgname]
+ [entry.attrib.__setitem__(x, pkginfo[x]) for x in pkginfo]
return
elif not self.pkgdir.entries.has_key("%s.xml" % metadata.image):
self.LogError("Pkgmgr: no package index for image %s" % metadata.image)
raise PluginExecutionError, ("Image", metadata.image)
pkglist = self.pkgdir["%s.xml" % (metadata.image)]
if pkglist.packages.has_key(pkgname):
- entry.attrib.update(pkglist.packages[pkgname])
+ pkginfo = pkglist.packages[pkgname]
+ [entry.attrib.__setitem__(x, pkginfo[x]) for x in pkginfo]
else:
raise PluginExecutionError, ("Package", pkgname)
diff --git a/src/lib/Server/Plugins/SSHbase.py b/src/lib/Server/Plugins/SSHbase.py
index 9c7fb9357..1d378f1f2 100644
--- a/src/lib/Server/Plugins/SSHbase.py
+++ b/src/lib/Server/Plugins/SSHbase.py
@@ -95,7 +95,8 @@ class SSHbase(Plugin):
for hostkey in [keytmpl % client for keytmpl in self.pubkeys]:
entry.text += "localhost,localhost.localdomain,127.0.0.1 %s" % (
self.repository.entries[hostkey].data)
- entry.attrib.update({'owner':'root', 'group':'root', 'perms':'0644'})
+ permdata = {'owner':'root', 'group':'root', 'perms':'0644'}
+ [entry.attrib.__setitem__(x, permdata[x]) for x in permdata]
def build_hk(self, entry, metadata):
'''This binds host key data into entries'''
@@ -109,14 +110,16 @@ class SSHbase(Plugin):
self.LogError("%s still not registered" % filename)
raise PluginExecutionError
keydata = self.repository.entries[filename].data
- perms = '0600'
+ permdata = {'owner':'root', 'group':'root'}
+ permdata['perms'] = '0600'
if entry.get('name')[-4:] == '.pub':
- perms = '0644'
- entry.attrib.update({'owner':'root', 'group':'root', 'perms':perms})
- entry.text = keydata
+ permdata['perms'] = '0644'
+ [entry.attrib.__setitem__(x, permdata[x]) for x in permdata]
if "ssh_host_key.H_" == filename[:15]:
entry.attrib['encoding'] = 'base64'
entry.text = b2a_base64(keydata)
+ else:
+ entry.text = keydata
def GenerateHostKeys(self, client):
'''Generate new host keys for client'''