summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJun Li <matthew.lijun@huawei.com>2017-05-09 00:58:34 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-05-09 00:58:34 +0000
commit9d074acbaabef39cade89da70f752e27f760a706 (patch)
tree03134ec91fb13fb5c349099ab921bce19c6623c1
parentb3e0ca2af151693f8e6440c78af733700a6296de (diff)
parent521d35a1accb93ab3fff7972fe5e7be279a60585 (diff)
Merge "Bugfix: Error when create pod.yaml file if one node's role is None"
-rw-r--r--utils/create_pod_file.py26
1 files changed, 18 insertions, 8 deletions
diff --git a/utils/create_pod_file.py b/utils/create_pod_file.py
index 22943fc97..7e30cc639 100644
--- a/utils/create_pod_file.py
+++ b/utils/create_pod_file.py
@@ -63,17 +63,27 @@ def create_file(handler):
node_list = []
index = 1
for node in nodes:
- if node.roles[0].lower() == "controller":
- node_info = {'name': "node%s" % index, 'role': node.roles[0],
- 'ip': node.ip, 'user': 'root'}
+ try:
+ if node.roles[0].lower() == "controller":
+ node_info = {'name': "node%s" % index, 'role': node.roles[0],
+ 'ip': node.ip, 'user': 'root'}
+ node_list.append(node_info)
+ index += 1
+ except Exception:
+ node_info = {'name': node.name, 'role': 'unknown', 'ip': node.ip,
+ 'user': 'root'}
node_list.append(node_info)
- index += 1
for node in nodes:
- if node.roles[0].lower() == "compute":
- node_info = {'name': "node%s" % index, 'role': node.roles[0],
- 'ip': node.ip, 'user': 'root'}
+ try:
+ if node.roles[0].lower() == "compute":
+ node_info = {'name': "node%s" % index, 'role': node.roles[0],
+ 'ip': node.ip, 'user': 'root'}
+ node_list.append(node_info)
+ index += 1
+ except Exception:
+ node_info = {'name': node.name, 'role': 'unknown', 'ip': node.ip,
+ 'user': 'root'}
node_list.append(node_info)
- index += 1
if args.INSTALLER_TYPE == 'compass':
for item in node_list:
item['password'] = 'root'