summaryrefslogtreecommitdiff
path: root/glanceclient/v2/metadefs.py
diff options
context:
space:
mode:
Diffstat (limited to 'glanceclient/v2/metadefs.py')
-rw-r--r--glanceclient/v2/metadefs.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/glanceclient/v2/metadefs.py b/glanceclient/v2/metadefs.py
index 1b641ac..a98a9fe 100644
--- a/glanceclient/v2/metadefs.py
+++ b/glanceclient/v2/metadefs.py
@@ -490,9 +490,8 @@ class TagController(object):
"""Create the list of tags.
:param namespace: Name of a namespace to which the Tags belong.
- :param kwargs: list of tags.
+ :param kwargs: list of tags, optional parameter append.
"""
-
tag_names = kwargs.pop('tags', [])
md_tag_list = []
@@ -502,11 +501,15 @@ class TagController(object):
except (warlock.InvalidOperation) as e:
raise TypeError(encodeutils.exception_to_unicode(e))
tags = {'tags': md_tag_list}
+ headers = {}
url = '/v2/metadefs/namespaces/%(namespace)s/tags' % {
- 'namespace': namespace}
+ 'namespace': namespace}
- resp, body = self.http_client.post(url, data=tags)
+ append = kwargs.pop('append', False)
+ if append:
+ headers['X-Openstack-Append'] = True
+ resp, body = self.http_client.post(url, headers=headers, data=tags)
body.pop('self', None)
for tag in body['tags']:
yield self.model(tag), resp