aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Barabas <peter.barabas@ericsson.com>2016-05-20 11:10:35 +0200
committerPeter Barabas <peter.barabas@ericsson.com>2016-05-20 11:10:35 +0200
commit71f00159f1613cfa2f1bcc27b693728ad8a58887 (patch)
treeaa83066d4def36a89ce9b3e5dd8d946df004f539
parent439f684991c36f61483b12134a8c981f78f0e473 (diff)
More rigorous Fuel environment check
get_env() used to raise an unhandled exception when reap.py was run on a Fuel node which didn't yet have an environment set up. Change-Id: I07c37db2d80e416d26fa4fb4907f4e438f1c44e5 Signed-off-by: Peter Barabas <peter.barabas@ericsson.com>
-rwxr-xr-xdeploy/reap.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/deploy/reap.py b/deploy/reap.py
index bf64d405a..22a55e75a 100755
--- a/deploy/reap.py
+++ b/deploy/reap.py
@@ -92,8 +92,10 @@ class Reap(object):
def get_env(self):
env_list = parse(exec_cmd('fuel env'))
- if len(env_list) > 1:
- err('Not exactly one environment')
+ if len(env_list) == 0:
+ err('No environment deployed')
+ elif len(env_list) > 1:
+ err('More than 1 environment deployed')
self.env = env_list[0]
self.env_id = self.env[E['id']]