Revision 4ddeb850

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)
b/kamaki/clients/storage/__init__.py
182 182
        :returns: (dict) request headers
183 183
        """
184 184
        self._assert_container()
185
        assert obj, 'Remote directory path is missing'
185 186
        path = path4url(self.account, self.container, obj)
186 187
        self.set_header('Content-Type', 'application/directory')
187 188
        self.set_header('Content-length', '0')

Also available in: Unified diff