Revision aa82dd5a kamaki/cli/commands/errors.py
b/kamaki/cli/commands/errors.py | ||
---|---|---|
358 | 358 |
'* get a list of image ids: /image list', |
359 | 359 |
'* details of image: /flavor info <image id>'] |
360 | 360 |
|
361 |
remote_image_file = [ |
|
362 |
'Suggested usage:', |
|
363 |
' /image register <image container>:<uploaded image file path>', |
|
364 |
'To set "image" as image container and "my_dir/img.diskdump" as', |
|
365 |
'the remote image file path, try one of the following:', |
|
366 |
'- <image container>:<remote path>', |
|
367 |
' e.g. image:/my_dir/img.diskdump', |
|
368 |
'- <remote path> -C <image container>', |
|
369 |
' e.g. /my_dir/img.diskdump -C image', |
|
370 |
'To check if the image file is accessible to current user:', |
|
371 |
' /file list <image container>', |
|
372 |
'If the file is located under a different user id "us3r1d"', |
|
373 |
' use the --fileowner=us3r1d argument e.g.:', |
|
374 |
' /image register "my" image:my_dir/img.diskdump --fileowner=us3r1d', |
|
375 |
'Note: The form pithos://<userid>/<container>/<path> is deprecated'] |
|
376 |
|
|
377 | 361 |
@classmethod |
378 | 362 |
def connection(this, foo): |
379 | 363 |
return generic._connection(foo, 'image.url') |
... | ... | |
412 | 396 |
raise |
413 | 397 |
return _raise |
414 | 398 |
|
415 |
@classmethod |
|
416 |
def image_file(this, foo): |
|
417 |
def _raise(self, name, container_path): |
|
418 |
try: |
|
419 |
return foo(self, name, container_path) |
|
420 |
except ClientError as ce: |
|
421 |
if ce.status in (400,): |
|
422 |
raiseCLIError( |
|
423 |
ce, |
|
424 |
'Nonexistent location for %s' % container_path, |
|
425 |
importance=2, details=this.remote_image_file) |
|
426 |
raise |
|
427 |
return _raise |
|
428 |
|
|
429 | 399 |
|
430 | 400 |
class pithos(object): |
431 | 401 |
container_howto = [ |
Also available in: Unified diff