Revision 92101413 kamaki/cli/commands/image.py
b/kamaki/cli/commands/image.py | ||
---|---|---|
75 | 75 |
@errors.generic.all |
76 | 76 |
def _run(self): |
77 | 77 |
token = self.config.get('image', 'token')\ |
78 |
or self.config.get('plankton', 'token')\ |
|
78 | 79 |
or self.config.get('global', 'token') |
79 | 80 |
|
80 | 81 |
if getattr(self, 'auth_base', False): |
81 | 82 |
plankton_endpoints = self.auth_base.get_service_endpoints( |
82 |
self.config.get('plankton', 'type'),
|
|
83 |
self.config.get('plankton', 'version'))
|
|
83 |
self.config.get('image', 'type'),
|
|
84 |
self.config.get('image', 'version'))
|
|
84 | 85 |
base_url = plankton_endpoints['publicURL'] |
85 | 86 |
else: |
86 |
base_url = self.config.get('plankton', 'url') |
|
87 |
base_url = self.config.get('image', 'url')\ |
|
88 |
or self.config.get('plankton', 'url') |
|
87 | 89 |
if not base_url: |
88 | 90 |
raise CLIBaseUrlError(service='plankton') |
89 | 91 |
|
... | ... | |
304 | 306 |
|
305 | 307 |
) |
306 | 308 |
|
307 |
def _get_uuid(self):
|
|
309 |
def _get_user_id(self):
|
|
308 | 310 |
atoken = self.client.token |
309 |
#user = AstakosClient(self.config.get('user', 'url'), atoken) |
|
310 |
#return user.term('uuid') |
|
311 | 311 |
if getattr(self, 'auth_base', False): |
312 | 312 |
return self.auth_base.term('id', atoken) |
313 | 313 |
else: |
314 |
astakos_url = self.config.get('astakos', 'url') |
|
314 |
astakos_url = self.config.get('user', 'url')\ |
|
315 |
or self.config.get('astakos', 'url') |
|
315 | 316 |
if not astakos_url: |
316 | 317 |
raise CLIBaseUrlError(service='astakos') |
317 | 318 |
user = AstakosClient(astakos_url, atoken) |
... | ... | |
327 | 328 |
self.config.get('pithos', 'version')) |
328 | 329 |
purl = pithos_endpoints['publicURL'] |
329 | 330 |
else: |
330 |
purl = self.config.get('pithos', 'url') |
|
331 |
purl = self.config.get('file', 'url')\ |
|
332 |
or self.config.get('pithos', 'url') |
|
331 | 333 |
if not purl: |
332 | 334 |
raise CLIBaseUrlError(service='pithos') |
333 |
return PithosClient(purl, ptoken, self._get_uuid(), container)
|
|
335 |
return PithosClient(purl, ptoken, self._get_user_id(), container)
|
|
334 | 336 |
|
335 | 337 |
def _store_remote_metafile(self, pclient, remote_path, metadata): |
336 | 338 |
return pclient.upload_from_string( |
Also available in: Unified diff