aboutsummaryrefslogtreecommitdiffstats
path: root/opnfv
diff options
context:
space:
mode:
authortomsou <soth@intracom-telecom.com>2017-02-20 16:02:02 +0000
committertomsou <soth@intracom-telecom.com>2017-02-21 12:47:18 +0000
commit5f92f97d630c24c0eead0992c9a0cf5dc538d3dd (patch)
tree4858f196039040643d4df0b3a3ff9da07ffa5fab /opnfv
parentbb67bf0617432cb902d4299c9f77559b0b22a7e9 (diff)
[deployment_handler] Opendaylight node check
- Enhance functionality of manager.py to check if a node is opendaylight - Update is_compute and is_controller methods, using the Role Class attributes Change-Id: Icf1d83b289bf6e87f83b0e1b5bdd2f9da436cde5 Signed-off-by: tomsou <soth@intracom-telecom.com>
Diffstat (limited to 'opnfv')
-rw-r--r--opnfv/deployment/manager.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/opnfv/deployment/manager.py b/opnfv/deployment/manager.py
index e1fd949..efa28ce 100644
--- a/opnfv/deployment/manager.py
+++ b/opnfv/deployment/manager.py
@@ -204,17 +204,19 @@ class Node(object):
'''
Returns if the node is a controller
'''
- if 'controller' in self.roles:
- return True
- return False
+ return Role.CONTROLLER in self.roles
def is_compute(self):
'''
Returns if the node is a compute
'''
- if 'compute' in self.roles:
- return True
- return False
+ return Role.COMPUTE in self.roles
+
+ def is_odl(self):
+ '''
+ Returns if the node is an opendaylight
+ '''
+ return Role.ODL in self.roles
def get_ovs_info(self):
'''