[Cluster-devel] conga/luci/utils luci_admin
rmccabe at sourceware.org
rmccabe at sourceware.org
Tue Jun 13 18:42:59 UTC 2006
CVSROOT: /cvs/cluster
Module name: conga
Changes by: rmccabe at sourceware.org 2006-06-13 18:42:58
Modified files:
luci/utils : luci_admin
Log message:
changes based on stan's suggestions
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/utils/luci_admin.diff?cvsroot=cluster&r1=1.5&r2=1.6
--- conga/luci/utils/luci_admin 2006/06/13 17:36:20 1.5
+++ conga/luci/utils/luci_admin 2006/06/13 18:42:58 1.6
@@ -45,10 +45,7 @@
temp = dataToXML(doc, dict[i], tagname)
node.appendChild(temp)
elif isinstance(dict[i], types.StringType) or isinstance(dict[i], types.IntType):
- temp = doc.createElement('item')
- temp.setAttribute('key', i)
- temp.setAttribute('value', str(dict[i]))
- node.appendChild(temp.cloneNode(True))
+ node.setAttribute(i, str(dict[i]))
elif isinstance(dict[i], types.ListType):
if len(dict[i]) < 1:
continue
@@ -102,8 +99,6 @@
null = file('/dev/null')
sys.stderr = null
- f.write('<?xml version="1.0"?>\n')
-
next_oid = None
while True:
oid, tid, data, next_oid = fs.record_iternext(next_oid)
@@ -179,10 +174,15 @@
if next_oid is None:
break
sys.stderr = temp
+ null.close()
+ conn.close()
+ db.close()
- backup = {'systemList': systems, 'cluterList': clusters, 'userList': users }
+ backup = {'systemList': systems, 'clusterList': clusters, 'userList': users }
doc = xml.dom.minidom.Document()
+ luciData = doc.createElement('luci')
+ doc.appendChild(luciData)
dataNode = dataToXML(doc, backup, 'backupData')
try:
@@ -194,7 +194,7 @@
if len(output) < 1:
raise
- certNode = doc.createElement('Certificate')
+ certNode = doc.createElement('certificate')
certNode.setAttribute('name', SSL_PRIVKEY_PATH)
certNode.setAttribute('data', output)
dataNode.appendChild(certNode.cloneNode(True))
@@ -212,7 +212,7 @@
if len(output) < 1:
raise
- certNode = doc.createElement('Certificate')
+ certNode = doc.createElement('certificate')
certNode.setAttribute('name', SSL_PUBKEY_PATH)
certNode.setAttribute('data', output)
dataNode.appendChild(certNode.cloneNode(True))
@@ -230,7 +230,7 @@
if len(output) < 1:
raise
- certNode = document.createElement('CertificateConfig')
+ certNode = document.createElement('certificateConfig')
certNode.setAttribute('name', SSL_KEYCONFIG_PATH)
certNode.setAttribute('data', output)
dataNode.appendChild(certNode.cloneNode(TRUE))
@@ -238,7 +238,8 @@
except:
sys.stderr.write('Unable to read ' + SSL_KEYCONFIG_PATH + '\n')
- f.write(dataNode.toprettyxml())
+ luciData.appendChild(dataNode)
+ f.write(doc.toprettyxml())
f.flush()
f.close()
More information about the Cluster-devel
mailing list