Revision 144b3551 kamaki/cli/__init__.py
b/kamaki/cli/__init__.py | ||
---|---|---|
223 | 223 |
|
224 | 224 |
def _init_session(arguments, is_non_API=False): |
225 | 225 |
""" |
226 |
:returns: (AuthCachedClient, str) authenticator and cloud remote name
|
|
226 |
:returns: (AuthCachedClient, str) authenticator and cloud name |
|
227 | 227 |
""" |
228 | 228 |
global _help |
229 | 229 |
_help = arguments['help'].value |
... | ... | |
248 | 248 |
return None, None |
249 | 249 |
|
250 | 250 |
cloud = arguments['cloud'].value or 'default' |
251 |
if not cloud in _cnf.value.keys('remote'):
|
|
251 |
if not cloud in _cnf.value.keys('cloud'):
|
|
252 | 252 |
raise CLIError( |
253 |
'No cloud remote "%s" is configured' % cloud,
|
|
253 |
'No cloud "%s" is configured' % cloud, |
|
254 | 254 |
importance=3, details=[ |
255 |
'To configure a new cloud remote, find and set the',
|
|
255 |
'To configure a new cloud, find and set the', |
|
256 | 256 |
'single authentication URL and token:', |
257 |
' kamaki config set remote.%s.url <URL>' % cloud,
|
|
258 |
' kamaki config set remote.%s.token <t0k3n>' % cloud])
|
|
257 |
' kamaki config set cloud.%s.url <URL>' % cloud,
|
|
258 |
' kamaki config set cloud.%s.token <t0k3n>' % cloud])
|
|
259 | 259 |
auth_args = dict() |
260 | 260 |
for term in ('url', 'token'): |
261 |
auth_args[term] = _cnf.get_remote(cloud, term)
|
|
261 |
auth_args[term] = _cnf.get_cloud(cloud, term)
|
|
262 | 262 |
if not auth_args[term]: |
263 | 263 |
raise CLIError( |
264 | 264 |
'No authentication %s provided for %s cloud' % (term, cloud), |
265 | 265 |
importance=3, details=[ |
266 | 266 |
'Get and set a %s for %s cloud:' % (term, cloud), |
267 |
' kamaki config set remote.%s.%s <t0k3n>' % (term, cloud)
|
|
267 |
' kamaki config set cloud.%s.%s <t0k3n>' % (term, cloud)
|
|
268 | 268 |
]) |
269 | 269 |
|
270 | 270 |
from kamaki.clients.astakos import AstakosClient as AuthCachedClient |
Also available in: Unified diff