Revision c4aefeaf kamaki/cli/commands/image.py

b/kamaki/cli/commands/image.py
319 319
        return container, path
320 320

  
321 321
    @errors.generic.all
322
    @errors.plankton.image_file
322 323
    @errors.plankton.connection
323 324
    def _run(self, name, container_path):
324 325
        container, path = self._get_container_path(container_path)
......
351 352

  
352 353
        #load properties
353 354
        properties = dict()
354
        if self['property_file']:
355
            for k, v in _load_image_props(self['property_file']).items():
356
                properties[k.lower()] = v
355
        pfile = self['property_file']
356
        if pfile:
357
            try:
358
                for k, v in _load_image_props(pfile).items():
359
                    properties[k.lower()] = v
360
            except Exception as e:
361
                raiseCLIError(
362
                    e, 'Format error in property file %s' % pfile,
363
                    details=[
364
                        'Expected content format:',
365
                        '  {',
366
                        '    "key1": "value1",',
367
                        '    "key2": "value2",',
368
                        '    ...',
369
                        '  }',
370
                        '',
371
                        'Parser:'
372
                    ])
357 373
        for k, v in self['properties'].items():
358 374
            properties[k.lower()] = v
359 375

  
......
368 384
                    property_file_location='%s:%s' % (container, prop_path),
369 385
                    headers=prop_headers))
370 386
            else:
371
                print('Property file location is %s:%s with version %s' % (
387
                print('Property file uploaded as %s:%s (version %s)' % (
372 388
                    container, prop_path, prop_headers['x-object-version']))
373 389

  
374 390
    def main(self, name, container___path):

Also available in: Unified diff