Revision 55c75058 kamaki/cli/commands/pithos.py
b/kamaki/cli/commands/pithos.py | ||
---|---|---|
727 | 727 |
default=''), |
728 | 728 |
source_version=ValueArgument( |
729 | 729 |
'copy specific version', |
730 |
('-S', '--source-version')) |
|
730 |
('-S', '--source-version')), |
|
731 |
with_output=FlagArgument('show request headers', ('--with-output')), |
|
732 |
json_output=FlagArgument('show headers in json', ('-j', '--json')) |
|
731 | 733 |
) |
732 | 734 |
|
733 | 735 |
@errors.generic.all |
... | ... | |
741 | 743 |
for src_obj, dst_obj in self.src_dst_pairs( |
742 | 744 |
dst_path, self['source_version']): |
743 | 745 |
no_source_object = False |
744 |
self.dst_client.copy_object( |
|
746 |
r = self.dst_client.copy_object(
|
|
745 | 747 |
src_container=self.client.container, |
746 | 748 |
src_object=src_obj, |
747 | 749 |
dst_container=self.dst_client.container, |
... | ... | |
754 | 756 |
raiseCLIError('No object %s in container %s' % ( |
755 | 757 |
self.path, |
756 | 758 |
self.container)) |
759 |
if self['json_output']: |
|
760 |
print_json(r) |
|
761 |
elif self['with_output']: |
|
762 |
print_dict(r) |
|
763 |
|
|
757 | 764 |
|
758 | 765 |
def main( |
759 | 766 |
self, source_container___path, |
... | ... | |
815 | 822 |
suffix_replace=ValueArgument( |
816 | 823 |
'Suffix of src to replace with add_suffix, if matched', |
817 | 824 |
'--suffix-to-replace', |
818 |
default='') |
|
825 |
default=''), |
|
826 |
with_output=FlagArgument('show request headers', ('--with-output')), |
|
827 |
json_output=FlagArgument('show headers in json', ('-j', '--json')) |
|
819 | 828 |
) |
820 | 829 |
|
821 | 830 |
@errors.generic.all |
... | ... | |
827 | 836 |
self['destination_account']) else None |
828 | 837 |
for src_obj, dst_obj in self.src_dst_pairs(dst_path): |
829 | 838 |
no_source_object = False |
830 |
self.dst_client.move_object( |
|
839 |
r = self.dst_client.move_object(
|
|
831 | 840 |
src_container=self.container, |
832 | 841 |
src_object=src_obj, |
833 | 842 |
dst_container=self.dst_client.container, |
834 | 843 |
dst_object=dst_obj, |
835 | 844 |
source_account=src_account, |
836 |
source_version=self['source_version'], |
|
837 | 845 |
public=self['public'], |
838 | 846 |
content_type=self['content_type']) |
839 | 847 |
if no_source_object: |
840 | 848 |
raiseCLIError('No object %s in container %s' % ( |
841 | 849 |
self.path, |
842 | 850 |
self.container)) |
851 |
if self['json_output']: |
|
852 |
print_json(r) |
|
853 |
elif self['with_output']: |
|
854 |
print_dict(r) |
|
843 | 855 |
|
844 | 856 |
def main( |
845 | 857 |
self, source_container___path, |
Also available in: Unified diff