hobo: fix --redeploy to find hobo.json and the appropriate service (#9771)

This commit is contained in:
Frédéric Péters 2016-01-26 11:31:48 +01:00
parent 4e5305b669
commit 1b7b49186d
1 changed files with 3 additions and 2 deletions

View File

@ -53,12 +53,13 @@ class CmdCheckHobos(Command):
for tenant in os.listdir(publisher.WcsPublisher.APP_DIR):
if tenant.endswith('.invalid'):
continue
hobo_json_path = os.path.join(tenant, 'hobo.json')
hobo_json_path = os.path.join(publisher.WcsPublisher.APP_DIR, tenant, 'hobo.json')
if not os.path.exists(hobo_json_path):
continue
hobo_json = json.load(open(hobo_json_path))
try:
me = [service for service in hobo_json['services'] if service['this'] is True][0]
me = [service for service in hobo_json['services']
if service.get('this') is True][0]
except IndexError:
pass
else: