From 71f00159f1613cfa2f1bcc27b693728ad8a58887 Mon Sep 17 00:00:00 2001 From: Peter Barabas Date: Fri, 20 May 2016 11:10:35 +0200 Subject: 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 --- deploy/reap.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'deploy') 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']] -- cgit 1.2.3-korg