hobo: exclude secondary services from the start (#14410)

This commit is contained in:
Frédéric Péters 2016-12-21 13:41:19 +01:00
parent 4c53eddc2d
commit 3dab5f9469
1 changed files with 7 additions and 4 deletions

View File

@ -89,13 +89,16 @@ class CmdCheckHobos(Command):
else:
self.all_services = json.load(file(args[1]))
service = [x for x in self.all_services.get('services', []) if \
x.get('service-id') == 'wcs' and x.get('base_url') == base_url][0]
try:
service = [x for x in self.all_services.get('services', []) if \
x.get('service-id') == 'wcs' and x.get('base_url') == base_url and
not x.get('secondary')][0]
except IndexError:
return
service['this'] = True
if base_url.endswith('/'): # wcs doesn't expect a trailing slash
service['base_url'] = base_url[:-1]
if service.get('secondary'):
return
pub.app_dir = os.path.join(global_app_dir,
self.get_instance_path(service))