Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
kamaki
Commits
9553da85
Commit
9553da85
authored
May 21, 2013
by
Stavros Sachtouris
Browse files
Print full and nice response in image register
parent
f17121cd
Changes
1
Hide whitespace changes
Inline
Side-by-side
kamaki/cli/commands/image.py
View file @
9553da85
...
...
@@ -96,7 +96,7 @@ def _validate_image_props(json_dict, return_str=False):
:raises AssertionError: Valid json but invalid image properties dict
"""
json_str
=
dumps
(
json_dict
)
json_str
=
dumps
(
json_dict
,
indent
=
2
)
for
k
,
v
in
json_dict
.
items
():
dealbreaker
=
isinstance
(
v
,
dict
)
or
isinstance
(
v
,
list
)
assert
not
dealbreaker
,
'Invalid property value for key %s'
%
k
...
...
@@ -307,6 +307,7 @@ class image_register(_init_image):
if
not
sep
or
not
container
or
not
path
:
raiseCLIError
(
'%s is not a valid pithos+ remote location'
%
container_path
,
importance
=
2
,
details
=
[
'To set "image" as container and "my_dir/img.diskdump" as'
,
'the image path, try one of the following as '
...
...
@@ -362,8 +363,13 @@ class image_register(_init_image):
if
pclient
:
prop_headers
=
pclient
.
upload_from_string
(
prop_path
,
_validate_image_props
(
properties
,
return_str
=
True
))
print
(
'Property file location is %s: %s'
%
(
container
,
prop_path
))
print
(
'
\t
with version %s'
%
prop_headers
[
'x-object-version'
])
if
self
[
'json_output'
]:
print_json
(
dict
(
property_file_location
=
'%s:%s'
%
(
container
,
prop_path
),
headers
=
prop_headers
))
else
:
print
(
'Property file location is %s:%s with version %s'
%
(
container
,
prop_path
,
prop_headers
[
'x-object-version'
]))
def
main
(
self
,
name
,
container___path
):
super
(
self
.
__class__
,
self
).
_run
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment