- #if not slice:
- # rspec_node['boot_state'] = node['boot_state']
- # if node['hostname'] in reserved_nodes:
- # rspec_node['boot_state'] = "Reserved"
- rspec_node['boot_state'] = node['boot_state']
- if node['hostname'] in reserved_nodes:
- rspec_node['boot_state'] = "Reserved"
- rspec_node['exclusive'] = 'True'
- rspec_node['hardware_types'] = [HardwareType({'name': 'slab-node'})]
-
- # only doing this because protogeni rspec needs
- # to advertise available initscripts
- #rspec_node['pl_initscripts'] = None
- # add site/interface info to nodes.
- # assumes that sites, interfaces and tags have already been prepared.
- #site = sites_dict[node['site_id']]
- location = Location({'country':'France'})
- rspec_node['location'] = location
-
-
- position = SlabPosition()
- for field in position :
- try:
- position[field] = node[field]
- except KeyError, error :
- logger.log_exc("SLABAGGREGATE\t get_rspec position %s "%(error))
-
- rspec_node['position'] = position
- #rspec_node['interfaces'] = []
- #if_count=0
- #for if_id in node['interface_ids']:
- #interface = Interface(interfaces[if_id])
- #interface['ipv4'] = interface['ip']
- #interface['component_id'] = PlXrn(auth=self.driver.hrn,
- #interface='node%s:eth%s' % (node['node_id'], if_count)).get_urn()
- # interfaces in the manifest need a client id
- #if slice:
- #interface['client_id'] = "%s:%s" % (node['node_id'], if_id)
- #rspec_node['interfaces'].append(interface)
- #if_count+=1
-
- #tags = [PLTag(node_tags[tag_id]) for tag_id in node['node_tag_ids']]
- # Granularity
- granularity = Granularity({'grain': grain})
- rspec_node['granularity'] = granularity
- rspec_node['tags'] = []
- if node['hostname'] in slivers:
- # add sliver info
- sliver = slivers[node['hostname']]
- rspec_node['sliver_id'] = sliver['sliver_id']
- rspec_node['client_id'] = node['hostname']
- rspec_node['slivers'] = [sliver]
-
- # slivers always provide the ssh service
- #login = Login({'authentication': 'ssh-keys', 'hostname': node['hostname'], 'port':'22', 'username': sliver['name']})
- #service = Services({'login': login})
- #rspec_node['services'] = [service]
- rspec_nodes.append(rspec_node)
+ position = SlabPosition()
+ for field in position :
+ try:
+ position[field] = node[field]
+ except KeyError, error :
+ logger.log_exc("SLABAGGREGATE\t get_rspec position %s "%(error))
+
+ rspec_node['position'] = position
+ #rspec_node['interfaces'] = []
+
+ #tags = [PLTag(node_tags[tag_id]) for tag_id in node['node_tag_ids']]
+ # Granularity
+ granularity = Granularity({'grain': grain})
+ rspec_node['granularity'] = granularity
+ rspec_node['tags'] = []
+ if node['hostname'] in slivers:
+ # add sliver info
+ sliver = slivers[node['hostname']]
+ rspec_node['sliver_id'] = sliver['sliver_id']
+ rspec_node['client_id'] = node['hostname']
+ rspec_node['slivers'] = [sliver]
+
+ # slivers always provide the ssh service
+ #login = Login({'authentication': 'ssh-keys', 'hostname': node['hostname'], 'port':'22', 'username': sliver['name']})
+ #service = Services({'login': login})
+ #rspec_node['services'] = [service]
+ rspec_nodes.append(rspec_node)