[deployment_handler] Add get_arch function 99/29099/4
authorjose.lausuch <jose.lausuch@ericsson.com>
Mon, 20 Feb 2017 19:22:47 +0000 (20:22 +0100)
committerAric Gardner <agardner@linuxfoundation.org>
Tue, 21 Feb 2017 20:25:45 +0000 (20:25 +0000)
This function will be used by ARM project to
detect the architecture of the compute nodes.

Example: http://paste.openstack.org/raw/599722/

Change-Id: Ic76f291468998d3a3d9e7df507a146da44f2f7f9
Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
modules/opnfv/deployment/manager.py

index 1dfbb09..7047a4d 100644 (file)
@@ -359,6 +359,18 @@ class DeploymentHandler(object):
         '''
         return self.installer_node
 
+    def get_arch(self):
+        '''
+            Returns the architecture of the first compute node found
+        '''
+        arch = None
+        for node in self.nodes:
+            if node.is_compute():
+                arch = node.cpu_info.get('arch', None)
+                if arch:
+                    break
+        return arch
+
     def get_deployment_info(self):
         '''
             Returns an object of type Deployment