summaryrefslogtreecommitdiffstats
path: root/modules/opnfv/deployment
diff options
context:
space:
mode:
authorhelenyao <yaohelan@huawei.com>2017-04-11 10:12:38 +0800
committerhelenyao <yaohelan@huawei.com>2017-04-11 14:59:32 +0800
commitf50fbcaadfa1577eb4dfeeb577bf77a90d16e5e1 (patch)
tree05e38d49c6cd6be7e8e26dc26be7740e8395ac5d /modules/opnfv/deployment
parentf5c14a8c277dfd487f080e6dfaedc37bf10b34d8 (diff)
Bugfix: Convert the string list to list
Compass information failed to be printed as the roles were string list Change-Id: I38037dae099862a040b817b690d451951e0bb23b Signed-off-by: helenyao <yaohelan@huawei.com>
Diffstat (limited to 'modules/opnfv/deployment')
-rw-r--r--modules/opnfv/deployment/compass/adapter.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/opnfv/deployment/compass/adapter.py b/modules/opnfv/deployment/compass/adapter.py
index 856c7fc38..38aa45227 100644
--- a/modules/opnfv/deployment/compass/adapter.py
+++ b/modules/opnfv/deployment/compass/adapter.py
@@ -7,6 +7,7 @@
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
+import json
import netaddr
import re
@@ -161,9 +162,10 @@ class CompassAdapter(manager.DeploymentHandler):
fields = lines[i].strip().encode().rsplit('\t')
host_id = fields[0].strip().encode()
name = 'host{0}'.format(host_id)
- node_roles = fields[1].strip().encode().lower()
+ node_roles_str = fields[1].strip().encode().lower()
+ node_roles_list = json.loads(node_roles_str)
node_roles = [manager.Role.ODL if x == 'odl'
- else x for x in node_roles]
+ else x for x in node_roles_list]
roles = [x for x in [manager.Role.CONTROLLER,
manager.Role.COMPUTE,
manager.Role.ODL,