Revision 4ddeb850 kamaki/cli/commands/pithos.py
b/kamaki/cli/commands/pithos.py | ||
---|---|---|
398 | 398 |
self._run() |
399 | 399 |
|
400 | 400 |
|
401 |
def _assert_path(self, path_or_url): |
|
402 |
if not self.path: |
|
403 |
raiseCLIError( |
|
404 |
'Directory path is missing in location %s' % path_or_url, |
|
405 |
details=['Location format: [[pithos://UUID]/CONTAINER/]PATH']) |
|
406 |
|
|
407 |
|
|
401 | 408 |
@command(file_cmds) |
402 | 409 |
class file_create(_pithos_container, _optional_output_cmd): |
403 | 410 |
"""Create an empty file""" |
... | ... | |
418 | 425 |
|
419 | 426 |
def main(self, path_or_url): |
420 | 427 |
super(self.__class__, self)._run(path_or_url) |
428 |
_assert_path(self, path_or_url) |
|
421 | 429 |
self._run() |
422 | 430 |
|
423 | 431 |
|
... | ... | |
429 | 437 |
@errors.generic.all |
430 | 438 |
@errors.pithos.connection |
431 | 439 |
@errors.pithos.container |
432 |
def _run(self): |
|
440 |
def _run(self, path):
|
|
433 | 441 |
self._optional_output(self.client.create_directory(self.path)) |
434 | 442 |
|
435 | 443 |
def main(self, path_or_url): |
436 | 444 |
super(self.__class__, self)._run(path_or_url) |
437 |
self._run() |
|
445 |
_assert_path(self, path_or_url) |
|
446 |
self._run(self.path) |
|
438 | 447 |
|
439 | 448 |
|
440 | 449 |
@command(file_cmds) |
Also available in: Unified diff