Revision cf115aed kamaki/cli/commands/pithos.py
b/kamaki/cli/commands/pithos.py | ||
---|---|---|
1509 | 1509 |
until=self['until'], delimiter=self['delimiter'])) |
1510 | 1510 |
else: |
1511 | 1511 |
print('Aborted') |
1512 |
else:
|
|
1512 |
elif self.container:
|
|
1513 | 1513 |
if self['recursive']: |
1514 | 1514 |
ask_msg = 'Delete container contents' |
1515 | 1515 |
else: |
... | ... | |
1519 | 1519 |
until=self['until'], delimiter=self['delimiter'])) |
1520 | 1520 |
else: |
1521 | 1521 |
print('Aborted') |
1522 |
else: |
|
1523 |
raiseCLIError('Nothing to delete, please provide container[:path]') |
|
1522 | 1524 |
|
1523 | 1525 |
def main(self, container____path__=None): |
1524 | 1526 |
super(self.__class__, self)._run(container____path__) |
... | ... | |
2054 | 2056 |
@errors.pithos.connection |
2055 | 2057 |
def _run(self): |
2056 | 2058 |
accounts = self.client.get_sharing_accounts(marker=self['marker']) |
2057 |
uuids = [acc['name'] for acc in accounts] |
|
2058 |
try: |
|
2059 |
astakos_responce = self.auth_base.post_user_catalogs(uuids) |
|
2060 |
usernames = astakos_responce.json |
|
2061 |
r = usernames['uuid_catalog'] |
|
2062 |
except Exception as e: |
|
2063 |
print 'WARNING: failed to call user_catalogs, %s' % e |
|
2064 |
r = dict(sharer_uuid=uuids) |
|
2065 |
usernames = accounts |
|
2066 |
if self['json_output'] or self['detail']: |
|
2067 |
self._print(usernames) |
|
2068 |
else: |
|
2069 |
self._print(r, print_dict) |
|
2059 |
if not self['json_output']: |
|
2060 |
usernames = self._uuids2usernames( |
|
2061 |
[acc['name'] for acc in accounts]) |
|
2062 |
for item in accounts: |
|
2063 |
uuid = item['name'] |
|
2064 |
item['id'], item['name'] = uuid, usernames[uuid] |
|
2065 |
if not self['detail']: |
|
2066 |
item.pop('last_modified') |
|
2067 |
self._print(accounts) |
|
2070 | 2068 |
|
2071 | 2069 |
def main(self): |
2072 | 2070 |
super(self.__class__, self)._run() |
Also available in: Unified diff