From ef8a2459818175390900f70d0dc9da8fa97d17fc Mon Sep 17 00:00:00 2001 From: Mohamed Larabi Date: Wed, 26 Sep 2012 16:25:30 +0200 Subject: [PATCH] Add exclusive tag in order to distinguish between reservable \n and shared nodes and show the granularity of the reservation system in case of reservable nodes --- sfa/planetlab/plaggregate.py | 8 +++++++- sfa/rspecs/elements/versions/sfav1Node.py | 14 ++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/sfa/planetlab/plaggregate.py b/sfa/planetlab/plaggregate.py index c4f2db81..00e62072 100644 --- a/sfa/planetlab/plaggregate.py +++ b/sfa/planetlab/plaggregate.py @@ -203,7 +203,13 @@ class PlAggregate: # do not include boot state ( element) in the manifest rspec if not slice: rspec_node['boot_state'] = node['boot_state'] - rspec_node['exclusive'] = 'false' + + #add the exclusive tag to distinguish between Shared and Reservable nodes + if node['node_type'] == 'reservable': + rspec_node['exclusive'] = 'true' + else: + rspec_node['exclusive'] = 'false' + rspec_node['hardware_types'] = [HardwareType({'name': 'plab-pc'}), HardwareType({'name': 'pc'})] # only doing this because protogeni rspec needs diff --git a/sfa/rspecs/elements/versions/sfav1Node.py b/sfa/rspecs/elements/versions/sfav1Node.py index 024a52e6..3ffc6c35 100644 --- a/sfa/rspecs/elements/versions/sfav1Node.py +++ b/sfa/rspecs/elements/versions/sfav1Node.py @@ -57,10 +57,16 @@ class SFAv1Node: if location: node_elem.add_instance('location', location, Location.fields) - # add granularity of the reservation system - granularity = node.get('granularity') - if granularity: - node_elem.add_instance('granularity', granularity, granularity.fields) + # add exclusive tag to distinguish between Reservable and Shared nodes + exclusive_elem = node_elem.add_element('exclusive') + if node.get('exclusive') and node.get('exclusive') == 'true': + exclusive_elem.set_text('TRUE') + # add granularity of the reservation system + granularity = node.get('granularity') + if granularity: + node_elem.add_instance('granularity', granularity, granularity.fields) + else: + exclusive_elem.set_text('FALSE') if isinstance(node.get('interfaces'), list): -- 2.47.0