summaryrefslogtreecommitdiff
path: root/swiftclient/command_helpers.py
diff options
context:
space:
mode:
authorClay Gerrard <clay.gerrard@gmail.com>2019-10-29 09:59:03 -0500
committerTim Burke <tim.burke@gmail.com>2020-04-08 13:07:26 -0700
commit78edffa46c591fdc53f253b343e1ea144e24089d (patch)
tree21205561c27782986e87d60ed1e12176b46d7129 /swiftclient/command_helpers.py
parent02e8f4f228c006927fe87f8a350c281b9cfccd98 (diff)
downloadpython-swiftclient-78edffa46c591fdc53f253b343e1ea144e24089d.tar.gz
object versioning features
* add --versions to list * add --versions to delete * add --version-id to stat * add --version-id to delete * add --version-id to download Change-Id: I89802064921778fee7efe57c7d60c976cdde3a27
Diffstat (limited to 'swiftclient/command_helpers.py')
-rw-r--r--swiftclient/command_helpers.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/swiftclient/command_helpers.py b/swiftclient/command_helpers.py
index 49ccad1..f37040f 100644
--- a/swiftclient/command_helpers.py
+++ b/swiftclient/command_helpers.py
@@ -143,7 +143,11 @@ def print_container_stats(items, headers, output_manager):
def stat_object(conn, options, container, obj):
req_headers = split_request_headers(options.get('header', []))
- headers = conn.head_object(container, obj, headers=req_headers)
+ query_string = None
+ if options.get('version_id') is not None:
+ query_string = 'version-id=%s' % options['version_id']
+ headers = conn.head_object(container, obj, headers=req_headers,
+ query_string=query_string)
items = []
if options['verbose'] > 1:
path = '%s/%s/%s' % (conn.url, container, obj)