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>
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']]