Revision ad71a0ce tools/store
b/tools/store | ||
---|---|---|
223 | 223 |
dest='file', default=None, |
224 | 224 |
help='save output in file') |
225 | 225 |
parser.add_option('--version', action='store', type='str', |
226 |
dest='version', default='list',
|
|
226 |
dest='version', default=None,
|
|
227 | 227 |
help='if \'list\' and in detailed mode get object\'s \ |
228 | 228 |
full version list otherwise get the specific \ |
229 | 229 |
version') |
... | ... | |
306 | 306 |
syntax = '<src container>/<src object> [<dst container>/]<dst object>' |
307 | 307 |
description = 'copies an object to a different location' |
308 | 308 |
|
309 |
def add_options(self, parser): |
|
310 |
parser.add_option('--version', action='store', |
|
311 |
dest='version', default=False, |
|
312 |
help='copy specific version') |
|
313 |
|
|
309 | 314 |
def execute(self, src, dst): |
310 | 315 |
src_container, sep, src_object = src.partition('/') |
311 | 316 |
dst_container, sep, dst_object = dst.partition('/') |
312 | 317 |
if not sep: |
313 | 318 |
dst_container = src_container |
314 | 319 |
dst_object = dst |
320 |
version = getattr(self, 'version') |
|
321 |
if version: |
|
322 |
headers = {} |
|
323 |
headers['SOURCE_VERSION'] = version |
|
315 | 324 |
self.client.copy_object(src_container, src_object, dst_container, |
316 | 325 |
dst_object) |
317 | 326 |
|
... | ... | |
397 | 406 |
syntax = '<src container>/<src object> [<dst container>/]<dst object>' |
398 | 407 |
description = 'moves an object to a different location' |
399 | 408 |
|
409 |
def add_options(self, parser): |
|
410 |
parser.add_option('--version', action='store', |
|
411 |
dest='version', default=False, |
|
412 |
help='move specific version') |
|
413 |
|
|
400 | 414 |
def execute(self, src, dst): |
401 | 415 |
src_container, sep, src_object = src.partition('/') |
402 | 416 |
dst_container, sep, dst_object = dst.partition('/') |
Also available in: Unified diff