X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Frspecs%2Felements%2Fversions%2Fsfav1Node.py;h=3ffc6c35d08ba9c7727cd47f07123562f57939b4;hb=7fcb8153bd74ce00f9f0d43c8aa090e0b70e345f;hp=f50e6877f3577a66d2bead484ba2da48a7acaa50;hpb=aef835d447ba01dbde23b3470071d1469c26d609;p=sfa.git diff --git a/sfa/rspecs/elements/versions/sfav1Node.py b/sfa/rspecs/elements/versions/sfav1Node.py index f50e6877..3ffc6c35 100644 --- a/sfa/rspecs/elements/versions/sfav1Node.py +++ b/sfa/rspecs/elements/versions/sfav1Node.py @@ -1,7 +1,7 @@ from sfa.util.sfalogging import logger from sfa.util.xml import XpathFilter -from sfa.util.plxrn import PlXrn, xrn_to_hostname from sfa.util.xrn import Xrn + from sfa.rspecs.elements.element import Element from sfa.rspecs.elements.node import Node from sfa.rspecs.elements.sliver import Sliver @@ -15,6 +15,8 @@ from sfa.rspecs.elements.versions.sfav1Sliver import SFAv1Sliver from sfa.rspecs.elements.versions.sfav1PLTag import SFAv1PLTag from sfa.rspecs.elements.versions.pgv2Services import PGv2Services +from sfa.planetlab.plxrn import xrn_to_hostname + class SFAv1Node: @staticmethod @@ -55,6 +57,18 @@ class SFAv1Node: if location: node_elem.add_instance('location', location, Location.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): for interface in node.get('interfaces', []): node_elem.add_instance('interface', interface, ['component_id', 'client_id', 'ipv4'])