add node tags to PGv2 and GENIv3 RSpecs
authorMohamed Larabi <mohamed.larabi@inria.fr>
Tue, 17 Sep 2013 09:46:09 +0000 (11:46 +0200)
committerMohamed Larabi <mohamed.larabi@inria.fr>
Tue, 17 Sep 2013 09:46:09 +0000 (11:46 +0200)
sfa/rspecs/elements/versions/pgv2Node.py

index 4b42403..ad7bd3d 100644 (file)
@@ -64,6 +64,15 @@ class PGv2Node:
                     for initscript in node.get('pl_initscripts', []):
                         slivers['tags'].append({'name': 'initscript', 'value': initscript['name']})
             PGv2SliverType.add_slivers(node_elem, slivers)
+
+            # advertise the node tags
+            tags = node.get('tags', [])
+            if tags:
+               for tag in tags:
+                        tag_elem = node_elem.add_element(tag['tagname'])
+                        tag_elem.set_text(tag['value'])
+            PGv2SliverType.add_slivers(node_elem, node.get('slivers', []))
+
         return node_elems
 
     @staticmethod