hobos: read json from a file if a filename is given on the command line (#6486)

This commit is contained in:
Frédéric Péters 2015-02-12 10:27:16 +01:00
parent 377911a431
commit d0e2120ef5
1 changed files with 5 additions and 2 deletions

View File

@ -42,8 +42,11 @@ class CmdCheckHobos(Command):
global_app_dir = pub.app_dir
# get environment definition from stdin
self.all_services = json.load(sys.stdin)
if not args or args[0] == '-':
# get environment definition from stdin
self.all_services = json.load(sys.stdin)
else:
self.all_services = json.load(file(args[0]))
services = [x for x in self.all_services.get('services', []) if \
x.get('service-id') == 'wcs']