add new topology parameter: arch
[csit.git] / resources / libraries / python / topology.py
index 38e08d2..13dbddd 100644 (file)
@@ -904,6 +904,22 @@ class Topology(object):
         """
         return node['host']
 
+    @staticmethod
+    def get_node_arch(node):
+        """Return arch of the node.
+           Default to x86_64 if no arch present
+
+        :param node: Node created from topology.
+        :type node: dict
+        :returns: Node architecture
+        :rtype: str
+        """
+        try:
+            return node['arch']
+        except KeyError:
+            node['arch'] = 'x86_64'
+            return 'x86_64'
+
     @staticmethod
     def get_cryptodev(node):
         """Return Crytodev configuration of the node.