aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCatalina Focsa <catalina.focsa@enea.com>2017-04-25 17:13:12 +0200
committerCatalina Focsa <catalina.focsa@enea.com>2017-04-25 17:17:41 +0200
commit9eb8c08a696be89a4e73d0e53b6aaf368634813a (patch)
treefa377ee8a38d4ca1a847eebce85fa7c59cc1f86f
parent046290a75b5f42c9b7a12ed881f1c83514556468 (diff)
Fix for reap.py giving negative id's for nodes
Sort node id's as integer values instead of strings in order to return the actual minimum value by which the new list of nodes is generated JIRA: https://jira.opnfv.org/browse/FUEL-208 Change-Id: If59d0d0ff9823076b337b042bceb4a736f1f9153 Signed-off-by: Catalina Focsa <catalina.focsa@enea.com>
-rw-r--r--deploy/reap.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/deploy/reap.py b/deploy/reap.py
index 69c98d10c..be729181f 100644
--- a/deploy/reap.py
+++ b/deploy/reap.py
@@ -167,17 +167,18 @@ class Reap(object):
def reap_nodes_interfaces_transformations(self):
node_list = parse(exec_cmd('fuel node'))
real_node_ids = [node[N['id']] for node in node_list]
+ real_node_ids = map(int, real_node_ids)
real_node_ids.sort()
- min_node = real_node_ids[0]
+ min_node = min(real_node_ids)
interfaces = {}
transformations = {}
dea_nodes = []
dha_nodes = []
for real_node_id in real_node_ids:
- node_id = int(real_node_id) - int(min_node) + 1
+ node_id = real_node_id - min_node + 1
self.last_node = node_id
- node = self.get_node_by_id(node_list, real_node_id)
+ node = self.get_node_by_id(node_list, str(real_node_id))
roles = commafy(node[N['roles']])
if not roles:
err('Fuel Node %s has no role' % real_node_id)