Commit f5ff79d9 authored by Stavros Sachtouris's avatar Stavros Sachtouris
Browse files

Prepend log_settings to auth_client init

parent 1144594b
......@@ -307,6 +307,11 @@ def _init_session(arguments, is_non_API=False):
else:
auth_base = AuthCachedClient(
auth_args['url'], auth_args['token'])
from kamaki.cli.commands import _command_init
fake_cmd = _command_init(arguments)
fake_cmd.client = auth_base
fake_cmd._set_log_params()
fake_cmd._update_max_threads()
auth_base.authenticate(token)
except ClientError as ce:
if ce.status in (401, ):
......
......@@ -134,7 +134,7 @@ class _command_init(object):
def _update_max_threads(self):
if getattr(self, 'client', None):
max_threads = int(self['config'].get_global('max_threads'))
assert max_threads > 0
assert max_threads > 0, 'invalid max_threads config option'
self.client.MAX_THREADS = max_threads
def _safe_progress_bar(self, msg, arg='progress_bar'):
......
......@@ -60,8 +60,8 @@ class _user_init(_command_init):
if getattr(self, 'cloud', False):
base_url = self._custom_url('astakos')
if base_url:
token = self._custom_token('astakos')\
or self.config.get_cloud(self.cloud, 'token')
token = self._custom_token(
'astakos') or self.config.get_cloud(self.cloud, 'token')
token = token.split()[0] if ' ' in token else token
self.client = AstakosClient(base_url=base_url, token=token)
return
......
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