Commit 819311d3 authored by Stavros Sachtouris's avatar Stavros Sachtouris
Browse files

Handle url proccessing even if url is unicode

Also, fix typos and default values for service configurations
parent e7884f25
......@@ -68,7 +68,7 @@ class generic(object):
' to get current token: /config get [server.]token'])
elif ce.status in range(-12, 200) + [302, 401, 403, 500]:
raiseCLIError(ce, importance=3, details=[
'Check if serviceis up'])
'Check if service is up'])
elif ce.status == 404 and 'kamakihttpresponse' in ce_msg:
client = getattr(self, 'client', None)
if not client:
......
......@@ -315,7 +315,7 @@ class image_register(_init_image, _optional_json):
if not astakos_url:
raise CLIBaseUrlError(service='astakos')
user = AstakosClient(astakos_url, atoken)
return user.term('uuid')
return user.term('id')
def _get_pithos_client(self, container):
if self['no_metafile_upload']:
......
......@@ -180,13 +180,13 @@ class _pithos_init(_command_init):
def _set_account(self):
if getattr(self, 'base_url', False):
self.account = self.auth_base.user_term('uuid', self.token)
self.account = self.auth_base.user_term('id', self.token)
else:
astakos_url = self.config('astakos', 'get')
if not astakos_url:
raise CLIBaseUrlError(service='astakos')
astakos = AstakosClient(astakos_url, self.token)
self.account = astakos.user_term('uuid')
self.account = astakos.user_term('id')
class _file_account_command(_pithos_init):
......
......@@ -78,7 +78,7 @@ DEFAULTS = {
},
'pithos': {
'type': 'object-store',
'version': 'v2'
'version': 'v1'
},
'cyclades': {
'type': 'compute',
......@@ -86,7 +86,7 @@ DEFAULTS = {
},
'plankton': {
'type': 'image',
'version': 'v2.0'
'version': 'v1.0'
},
'astakos': {
'type': 'identity',
......
......@@ -115,7 +115,7 @@ class RequestManager(Logged):
:returns: (scheme, netloc)
"""
url = _encode(url) if url else 'http://127.0.0.1/'
url = _encode(str(url)) if url else 'http://127.0.0.1/'
url += '' if url.endswith('/') else '/'
if path:
url += _encode(path[1:] if path.startswith('/') else path)
......
......@@ -104,7 +104,6 @@ class AstakosClient(Client):
service = self.get_service_details(service_type, token)
matches = []
for endpoint in service['endpoints']:
if (not version) or (
endpoint['versionId'].lower() == version.lower()):
matches.append(endpoint)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment