Revision 9553da85
b/kamaki/cli/commands/image.py | ||
---|---|---|
96 | 96 |
|
97 | 97 |
:raises AssertionError: Valid json but invalid image properties dict |
98 | 98 |
""" |
99 |
json_str = dumps(json_dict) |
|
99 |
json_str = dumps(json_dict, indent=2)
|
|
100 | 100 |
for k, v in json_dict.items(): |
101 | 101 |
dealbreaker = isinstance(v, dict) or isinstance(v, list) |
102 | 102 |
assert not dealbreaker, 'Invalid property value for key %s' % k |
... | ... | |
307 | 307 |
if not sep or not container or not path: |
308 | 308 |
raiseCLIError( |
309 | 309 |
'%s is not a valid pithos+ remote location' % container_path, |
310 |
importance=2, |
|
310 | 311 |
details=[ |
311 | 312 |
'To set "image" as container and "my_dir/img.diskdump" as', |
312 | 313 |
'the image path, try one of the following as ' |
... | ... | |
362 | 363 |
if pclient: |
363 | 364 |
prop_headers = pclient.upload_from_string( |
364 | 365 |
prop_path, _validate_image_props(properties, return_str=True)) |
365 |
print('Property file location is %s: %s' % (container, prop_path)) |
|
366 |
print('\twith version %s' % prop_headers['x-object-version']) |
|
366 |
if self['json_output']: |
|
367 |
print_json(dict( |
|
368 |
property_file_location='%s:%s' % (container, prop_path), |
|
369 |
headers=prop_headers)) |
|
370 |
else: |
|
371 |
print('Property file location is %s:%s with version %s' % ( |
|
372 |
container, prop_path, prop_headers['x-object-version'])) |
|
367 | 373 |
|
368 | 374 |
def main(self, name, container___path): |
369 | 375 |
super(self.__class__, self)._run() |
Also available in: Unified diff