Fix version in requests to GLARE

Due to the fact that now GLARE uses separate endpoint for access [1],
all requests in muranoclient should be updated.

[1] b974a63660

Change-Id: I12ac3af4697fff7c07e5e6b41ba7047549891d45
Closes-Bug: #1549201
This commit is contained in:
Dmytro Dovbii 2016-02-24 11:26:22 +02:00
parent 4541d1dbd2
commit 79681e9aff
1 changed files with 17 additions and 17 deletions

View File

@ -70,7 +70,7 @@ class Controller(object):
type_name, type_version = self._check_type_params(type_name,
type_version)
kwargs.update({'name': name, 'version': version})
url = '/v3/artifacts/%s/v%s/drafts' % (type_name, type_version)
url = '/v0.1/artifacts/%s/v%s/drafts' % (type_name, type_version)
resp, body = self.http_client.post(url, data=kwargs)
return ArtifactType(**body)
@ -84,8 +84,8 @@ class Controller(object):
"""
type_name, type_version = self._check_type_params(type_name,
type_version)
url = '/v3/artifacts/%s/v%s/%s' % (type_name, type_version,
artifact_id)
url = '/v0.1/artifacts/%s/v%s/%s' % (type_name, type_version,
artifact_id)
hdrs = {
'Content-Type': 'application/openstack-images-v2.1-json-patch'}
@ -131,8 +131,8 @@ class Controller(object):
type_name, type_version = self._check_type_params(type_name,
type_version)
url = '/v3/artifacts/%s/v%s/%s' % (type_name, type_version,
artifact_id)
url = '/v0.1/artifacts/%s/v%s/%s' % (type_name, type_version,
artifact_id)
if show_level:
if show_level not in ArtifactType.supported_show_levels:
msg = "Invalid show level: %s" % show_level
@ -194,10 +194,10 @@ class Controller(object):
url_params.append({param: value})
if drafts:
url = '/v3/artifacts/%s/' \
url = '/v0.1/artifacts/%s/' \
'v%s/drafts?' % (type_name, type_version)
else:
url = '/v3/artifacts/%s/v%s?' % (type_name, type_version)
url = '/v0.1/artifacts/%s/v%s?' % (type_name, type_version)
for param in url_params:
url = '%s&%s' % (url, parse.urlencode(param))
@ -217,8 +217,8 @@ class Controller(object):
type_name, type_version = self._check_type_params(type_name,
type_version)
url = '/v3/artifacts/%s/v%s/%s/publish' % (type_name, type_version,
artifact_id)
url = '/v0.1/artifacts/%s/v%s/%s/publish' % (type_name, type_version,
artifact_id)
resp, body = self.http_client.post(url)
return ArtifactType(**body)
@ -233,8 +233,8 @@ class Controller(object):
"""
type_name, type_version = self._check_type_params(type_name,
type_version)
url = '/v3/artifacts/%s/v%s/%s' % (type_name, type_version,
artifact_id)
url = '/v0.1/artifacts/%s/v%s/%s' % (type_name, type_version,
artifact_id)
self.http_client.delete(url)
def upload_blob(self, artifact_id, blob_property, data, position=None,
@ -250,8 +250,8 @@ class Controller(object):
type_version)
hdrs = {'Content-Type': 'application/octet-stream'}
url = '/v3/artifacts/%s/v%s/%s/%s' % (type_name, type_version,
artifact_id, blob_property)
url = '/v0.1/artifacts/%s/v%s/%s/%s' % (type_name, type_version,
artifact_id, blob_property)
if position:
url += "/%s" % position
@ -269,8 +269,8 @@ class Controller(object):
"""
type_name, type_version = self._check_type_params(type_name,
type_version)
url = '/v3/artifacts/%s/v%s/%s/%s' % (type_name, type_version,
artifact_id, blob_property)
url = '/v0.1/artifacts/%s/v%s/%s/%s' % (type_name, type_version,
artifact_id, blob_property)
if position:
url += '/%s' % position
@ -296,8 +296,8 @@ class Controller(object):
"""
type_name, type_version = self._check_type_params(type_name,
type_version)
url = '/v3/artifacts/%s/v%s/%s/%s' % (type_name, type_version,
artifact_id, blob_property)
url = '/v0.1/artifacts/%s/v%s/%s/%s' % (type_name, type_version,
artifact_id, blob_property)
if position:
url += '/%s' % position
self.http_client.delete(url)