summaryrefslogtreecommitdiffstats
path: root/deploy
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-26 12:12:22 +0000
commite14f155b82b0fcd695606e785966d27af7b9e3de (patch)
tree05e994e5254f78896ab1f87179d19ecd5cbe60b3 /deploy
parent26ddcc786462f926ab576f53694cba5a903f9bef (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> (cherry picked from commit 9eb8c08a696be89a4e73d0e53b6aaf368634813a)
Diffstat (limited to 'deploy')
-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)