diff options
Diffstat (limited to 'lorry')
-rwxr-xr-x | lorry | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -1,5 +1,5 @@ #!/usr/bin/python -# Copyright (C) 2013-2015 Codethink Limited +# Copyright (C) 2013-2016 Codethink Limited # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -27,6 +27,8 @@ import shutil import traceback import functools +import yaml + __version__ = '0.0' lorry_path = os.path.realpath(__file__) @@ -107,7 +109,11 @@ class Lorry(cliapp.Application): for arg in args: self.progress('Processing spec file %s' % arg) with open(arg) as f: - specs = json.load(f) + try: + specs = yaml.safe_load(f) + except yaml.YAMLError: + f.seek(0) + specs = json.load(f) for name in sorted(specs.keys()): self.progress('Getting: %s' % name) try: |