From 9eb8c08a696be89a4e73d0e53b6aaf368634813a Mon Sep 17 00:00:00 2001 From: Catalina Focsa Date: Tue, 25 Apr 2017 17:13:12 +0200 Subject: [PATCH] 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 --- deploy/reap.py | 7 ++++--- 1 file 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) -- 2.16.6