From a904bea097a63399426692014adc48e8cddee59d Mon Sep 17 00:00:00 2001 From: tomsou Date: Mon, 20 Feb 2017 16:02:02 +0000 Subject: [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 --- modules/opnfv/deployment/manager.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'modules') diff --git a/modules/opnfv/deployment/manager.py b/modules/opnfv/deployment/manager.py index e1fd9497f..efa28cea8 100644 --- a/modules/opnfv/deployment/manager.py +++ b/modules/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): ''' -- cgit 1.2.3-korg