Revision cf3e2989 kamaki/cli/commands/cyclades.py
b/kamaki/cli/commands/cyclades.py | ||
---|---|---|
173 | 173 |
|
174 | 174 |
def _add_user_name(self, servers): |
175 | 175 |
uuids = self._uuids2usernames(list(set( |
176 |
[srv['user_id'] for srv in servers] + |
|
177 |
[srv['tenant_id'] for srv in servers]))) |
|
176 |
[srv['user_id'] for srv in servers]))) |
|
178 | 177 |
for srv in servers: |
179 | 178 |
srv['user_id'] += ' (%s)' % uuids[srv['user_id']] |
180 |
srv['tenant_id'] += ' (%s)' % uuids[srv['tenant_id']] |
|
181 | 179 |
return servers |
182 | 180 |
|
183 | 181 |
def _apply_common_filters(self, servers): |
... | ... | |
293 | 291 |
self._print(self.client.get_server_diagnostics(server_id)) |
294 | 292 |
else: |
295 | 293 |
vm = self.client.get_server_details(server_id) |
296 |
uuids = self._uuids2usernames([vm['user_id'], vm['tenant_id']])
|
|
294 |
uuids = self._uuids2usernames([vm['user_id']]) |
|
297 | 295 |
vm['user_id'] += ' (%s)' % uuids[vm['user_id']] |
298 |
vm['tenant_id'] += ' (%s)' % uuids[vm['tenant_id']] |
|
299 | 296 |
self._print(vm, self.print_dict) |
300 | 297 |
|
301 | 298 |
def main(self, server_id): |
... | ... | |
500 | 497 |
if not r: |
501 | 498 |
self.error('Create %s: server response was %s' % (name, r)) |
502 | 499 |
continue |
503 |
usernames = self._uuids2usernames( |
|
504 |
[r['user_id'], r['tenant_id']]) |
|
500 |
usernames = self._uuids2usernames([r['user_id']]) |
|
505 | 501 |
r['user_id'] += ' (%s)' % usernames[r['user_id']] |
506 |
r['tenant_id'] += ' (%s)' % usernames[r['tenant_id']] |
|
507 | 502 |
self._print(r, self.print_dict) |
508 | 503 |
if self['wait']: |
509 | 504 |
self._wait(r['id'], r['status'] or 'BUILD') |
... | ... | |
912 | 907 |
user_id, tenant_id, uuids = net['user_id'], net['tenant_id'], [] |
913 | 908 |
if user_id: |
914 | 909 |
uuids.append(user_id) |
915 |
if tenant_id: |
|
916 |
uuids.append(tenant_id) |
|
917 |
if uuids: |
|
910 |
if uuids or tenant_id: |
|
918 | 911 |
usernames = self._uuids2usernames(uuids) |
919 | 912 |
if user_id: |
920 | 913 |
net['user_id'] += ' (%s)' % usernames[user_id] |
921 |
if tenant_id: |
|
922 |
net['tenant_id'] += ' (%s)' % usernames[tenant_id] |
Also available in: Unified diff