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 14:10:08 +0000 (16:10 +0200)
sfa/rspecs/elements/versions/pgv2Node.py

index fb9a9ac..ba854d0 100644 (file)
@@ -61,6 +61,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