X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=support-scripts%2Fgen-sites-xml.py;h=13db800cb8c7611e18367777a2010002e770b018;hb=HEAD;hp=13de2556ad8fcc0da8e35a934cb5228eb2ab9816;hpb=1e57cbd7d8f11217df24a4ea07599fb38aac8c31;p=myplc.git diff --git a/support-scripts/gen-sites-xml.py b/support-scripts/gen-sites-xml.py index 13de255..13db800 100755 --- a/support-scripts/gen-sites-xml.py +++ b/support-scripts/gen-sites-xml.py @@ -5,8 +5,6 @@ # Mark Huang # Copyright (C) 2006 The Trustees of Princeton University # -# $Id: gen-sites-xml.py,v 1.8 2007/09/14 20:08:28 tmack Exp $ -# import os, sys import getopt @@ -76,10 +74,10 @@ plc = Shell(globals()) # begin() -GetNodes(None, ['node_id', 'model', 'boot_state', 'hostname', 'version', 'ssh_rsa_key', 'nodenetwork_ids', 'slice_ids_whitelist']) -GetNodeNetworks({'is_primary': True}, ['nodenetwork_id', 'node_id', 'ip', 'mac', 'bwlimit']) +GetNodes(None, ['node_id', 'model', 'boot_state', 'hostname', 'version', 'ssh_rsa_key', 'interface_ids', 'slice_ids_whitelist']) +GetInterfaces({'is_primary': True}, ['interface_id', 'node_id', 'ip', 'mac', 'bwlimit']) GetSites(None, ['name', 'latitude', 'longitude', 'url', 'site_id', 'login_base', 'abbreviated_name', 'node_ids']) -GetNodeGroups(['Alpha', 'Beta', 'Rollout', 'Production'], ['name', 'node_ids']) +GetNodeGroups(['Alpha', 'Beta', 'Rollout', 'Production'], ['groupname', 'node_ids']) (nodes, nodenetworks, sites, groups) = commit() # remove whitelisted nodes @@ -94,7 +92,7 @@ for nodenetwork in nodenetworks: for key, value in nodenetwork.iteritems(): node[key] = value -group_node_ids = dict([(group['name'], group['node_ids']) for group in groups]) +group_node_ids = dict([(group['groupname'], group['node_ids']) for group in groups]) class PrettyXMLGenerator(XMLGenerator): """ @@ -147,7 +145,7 @@ class PrettyXMLGenerator(XMLGenerator): self.write('<' + name) for (name, value) in attrs.items(): - self.write(' %s=%s' % (name, quoteattr(value))) + self.write(' %s=%s' % (name, quoteattr(value.strip()))) self.write('/>') if newl: