summaryrefslogtreecommitdiffstats
path: root/deploy/dea.py
diff options
context:
space:
mode:
authorSzilard Cserey <szilard.cserey@gmail.com>2016-03-09 17:52:18 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2016-03-09 17:52:19 +0000
commit735dc3a58e599f89e1e214ba41f2a023f97085fb (patch)
treeb3c56ea959b24acbb645a0fdce329ba92a63f47e /deploy/dea.py
parentbdf4ad5d52b8094bc2f99195ae46f6904e3d42e2 (diff)
parent1ef2a5abcdacf3274e4ed17c612835ae10cb34d8 (diff)
Merge "Make number of cpus configurable in dha file"
Diffstat (limited to 'deploy/dea.py')
-rw-r--r--deploy/dea.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/deploy/dea.py b/deploy/dea.py
index b5b63f7cc..1ac048e06 100644
--- a/deploy/dea.py
+++ b/deploy/dea.py
@@ -65,9 +65,15 @@ class DeploymentEnvironmentAdapter(object):
if node['id'] == node_id and property_name in node:
return node[property_name]
- def get_node_role(self, node_id):
+ def get_node_roles(self, node_id):
return self.get_node_property(node_id, 'role')
+ def get_node_main_role(self, node_id, fuel_node_id):
+ if node_id == fuel_node_id:
+ return 'fuel'
+ roles = self.get_node_roles(node_id)
+ return 'controller' if 'controller' in roles else 'compute'
+
def get_node_ids(self):
node_ids = []
for node in self.dea_struct['nodes']: