From: Tony Mack Date: Mon, 23 May 2011 00:36:39 +0000 (-0400) Subject: misc pg rspec fixes X-Git-Tag: sfa-1.0-22~25 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=65648e1e662aaa4bff322dda576f21c38f8b4faa;p=sfa.git misc pg rspec fixes --- diff --git a/sfa/plc/aggregate.py b/sfa/plc/aggregate.py index 6874d644..4dedb7fe 100644 --- a/sfa/plc/aggregate.py +++ b/sfa/plc/aggregate.py @@ -61,7 +61,7 @@ class Aggregate: node['network'] = self.api.hrn node['network_urn'] = hrn_to_urn(self.api.hrn, 'authority+sa') node['urn'] = hostname_to_urn(self.api.hrn, site['login_base'], node['hostname']) - node['site_urn'] = hrn_to_urn(PlXrn.site_hrn(self.api.hrn, site['login_base']), 'authority') + node['site_urn'] = hrn_to_urn(PlXrn.site_hrn(self.api.hrn, site['login_base']), 'authority+am') node['site'] = site node['interfaces'] = interfaces node['tags'] = tags diff --git a/sfa/rspecs/pg_rspec.py b/sfa/rspecs/pg_rspec.py index 9a3ce193..60f9c3e4 100755 --- a/sfa/rspecs/pg_rspec.py +++ b/sfa/rspecs/pg_rspec.py @@ -98,17 +98,18 @@ class PGRSpec(RSpec): # node already exists continue - node_tag = etree.SubElement(self.xml, 'node') + node_tag = etree.SubElement(self.xml, 'node', exclusive='false') if 'network_urn' in node: node_tag.set('component_manager_id', node['network_urn']) if 'urn' in node: node_tag.set('component_id', node['urn']) if 'hostname' in node: node_tag.set('component_name', node['hostname']) - node_type_tag = etree.SubElement(node_tag, 'node_type', type_name='pcvm', type_slots='100') - available_tag = etree.SubElement(node_tag, 'available').text = 'true' - exclusive_tag = etree.SubElement(node_tag, 'exclusive').text = 'false' - location_tag = etree.SubElement(node_tag, 'location', location="US") + # TODO: should replace plab-pc with pc model + node_type_tag = etree.SubElement(node_tag, 'hardware_type', type_name='plab-pc') + node_type_tag = etree.SubElement(node_tag, 'hardware_type', type_name='pc') + available_tag = etree.SubElement(node_tag, 'available', now='true') + location_tag = etree.SubElement(node_tag, 'country', location="us") if 'site' in node: if 'longitude' in node['site']: location_tag.set('longitude', str(node['site']['longitude'])) @@ -130,7 +131,7 @@ class PGRSpec(RSpec): if nodes: node = nodes[0] node.set('client_id', hostname) - etree.SubElement(node, 'sliver_type', name='planetlab-vnode') + etree.SubElement(node, 'sliver_type', name='plab-vnode') def add_interfaces(self, interfaces, check_for_dupes=False): pass diff --git a/sfa/rspecs/rspec.py b/sfa/rspecs/rspec.py index 9bb51680..bf3db646 100755 --- a/sfa/rspecs/rspec.py +++ b/sfa/rspecs/rspec.py @@ -35,7 +35,7 @@ class RSpec: generated_ts = now.strftime(date_format) expires_ts = (now + timedelta(hours=1)).strftime(date_format) self.parse_rspec(self.template, self.namespaces) - self.xml.set('valid_until', expires_ts) + self.xml.set('expires', expires_ts) self.xml.set('generated', generated_ts) def parse_rspec(self, rspec, namespaces={}):