Replace six.iteritems() with .items()
1. As mentioned in [1], we should avoid using six.iteritems to achieve iterators. We can use dict.items instead, as it will return iterators in PY3 as well. And dict.items/keys will more readable. 2. In py2, the performance about list should be negligible, see the link [2]. [1] https://wiki.openstack.org/wiki/Python3 [2] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html Co-Authored-By: Akihiro Motoki <amotoki@gmail.com> Change-Id: I4b9edb326444264c0f6c4ad281acaac356a07e85 Implements: blueprint replace-iteritems-with-items
This commit is contained in:
parent
4b575083b7
commit
d15bbada73
@ -93,8 +93,7 @@ OpenStackClient strives to be Python 3.3 compatible. Common guidelines:
|
|||||||
|
|
||||||
* Convert print statements to functions: print statements should be converted
|
* Convert print statements to functions: print statements should be converted
|
||||||
to an appropriate log or other output mechanism.
|
to an appropriate log or other output mechanism.
|
||||||
* Use six where applicable: x.iteritems is converted to six.iteritems(x)
|
* Prefer to x.items() over six.iteritems(x).
|
||||||
for example.
|
|
||||||
|
|
||||||
Running Tests
|
Running Tests
|
||||||
-------------
|
-------------
|
||||||
|
@ -19,7 +19,6 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
from six.moves import urllib
|
from six.moves import urllib
|
||||||
|
|
||||||
from openstackclient.api import api
|
from openstackclient.api import api
|
||||||
@ -559,7 +558,7 @@ class APIv1(api.BaseAPI):
|
|||||||
log = logging.getLogger(__name__ + '._set_properties')
|
log = logging.getLogger(__name__ + '._set_properties')
|
||||||
|
|
||||||
headers = {}
|
headers = {}
|
||||||
for k, v in six.iteritems(properties):
|
for k, v in properties.items():
|
||||||
if not utils.is_ascii(k) or not utils.is_ascii(v):
|
if not utils.is_ascii(k) or not utils.is_ascii(v):
|
||||||
log.error('Cannot set property %s to non-ascii value', k)
|
log.error('Cannot set property %s to non-ascii value', k)
|
||||||
continue
|
continue
|
||||||
@ -572,7 +571,7 @@ class APIv1(api.BaseAPI):
|
|||||||
# Add in properties as a top level key, this is consistent with other
|
# Add in properties as a top level key, this is consistent with other
|
||||||
# OSC commands
|
# OSC commands
|
||||||
properties = {}
|
properties = {}
|
||||||
for k, v in six.iteritems(headers):
|
for k, v in headers.items():
|
||||||
if k.lower().startswith(header_tag):
|
if k.lower().startswith(header_tag):
|
||||||
properties[k[len(header_tag):]] = v
|
properties[k[len(header_tag):]] = v
|
||||||
return properties
|
return properties
|
||||||
|
@ -19,7 +19,6 @@ import logging
|
|||||||
from novaclient import exceptions as nova_exceptions
|
from novaclient import exceptions as nova_exceptions
|
||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
@ -47,11 +46,11 @@ def _xform_compute_availability_zone(az, include_extra):
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
if hasattr(az, 'hosts') and az.hosts:
|
if hasattr(az, 'hosts') and az.hosts:
|
||||||
for host, services in six.iteritems(az.hosts):
|
for host, services in az.hosts.items():
|
||||||
host_info = copy.deepcopy(zone_info)
|
host_info = copy.deepcopy(zone_info)
|
||||||
host_info['host_name'] = host
|
host_info['host_name'] = host
|
||||||
|
|
||||||
for svc, state in six.iteritems(services):
|
for svc, state in services.items():
|
||||||
info = copy.deepcopy(host_info)
|
info = copy.deepcopy(host_info)
|
||||||
info['service_name'] = svc
|
info['service_name'] = svc
|
||||||
info['service_status'] = '%s %s %s' % (
|
info['service_status'] = '%s %s %s' % (
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
|
|
||||||
from keystoneauth1.loading import base
|
from keystoneauth1.loading import base
|
||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
@ -59,9 +58,9 @@ class ShowConfiguration(command.ShowOne):
|
|||||||
if o.secret
|
if o.secret
|
||||||
]
|
]
|
||||||
|
|
||||||
for key, value in six.iteritems(info.pop('auth', {})):
|
for key, value in info.pop('auth', {}).items():
|
||||||
if parsed_args.mask and key.lower() in secret_opts:
|
if parsed_args.mask and key.lower() in secret_opts:
|
||||||
value = REDACTED
|
value = REDACTED
|
||||||
info['auth.' + key] = value
|
info['auth.' + key] = value
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(info)))
|
return zip(*sorted(info.items()))
|
||||||
|
@ -19,7 +19,6 @@ import sys
|
|||||||
|
|
||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
@ -113,4 +112,4 @@ class ListModule(command.ShowOne):
|
|||||||
# Catch all exceptions, just skip it
|
# Catch all exceptions, just skip it
|
||||||
pass
|
pass
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(data)))
|
return zip(*sorted(data.items()))
|
||||||
|
@ -21,7 +21,6 @@ import sys
|
|||||||
|
|
||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
from openstackclient.network import common
|
from openstackclient.network import common
|
||||||
@ -663,4 +662,4 @@ class ShowQuota(command.ShowOne, BaseQuota):
|
|||||||
project_name = project_info['name']
|
project_name = project_info['name']
|
||||||
info['project_name'] = project_name
|
info['project_name'] = project_name
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(info)))
|
return zip(*sorted(info.items()))
|
||||||
|
@ -20,7 +20,6 @@ import logging
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
@ -77,7 +76,7 @@ class CreateAgent(command.ShowOne):
|
|||||||
parsed_args.hypervisor
|
parsed_args.hypervisor
|
||||||
)
|
)
|
||||||
agent = compute_client.agents.create(*args)._info.copy()
|
agent = compute_client.agents.create(*args)._info.copy()
|
||||||
return zip(*sorted(six.iteritems(agent)))
|
return zip(*sorted(agent.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteAgent(command.Command):
|
class DeleteAgent(command.Command):
|
||||||
|
@ -23,7 +23,6 @@ from osc_lib.cli import parseractions
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
@ -68,7 +67,7 @@ class AddAggregateHost(command.ShowOne):
|
|||||||
'properties': format_columns.DictColumn(info.pop('metadata')),
|
'properties': format_columns.DictColumn(info.pop('metadata')),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
return zip(*sorted(six.iteritems(info)))
|
return zip(*sorted(info.items()))
|
||||||
|
|
||||||
|
|
||||||
class CreateAggregate(command.ShowOne):
|
class CreateAggregate(command.ShowOne):
|
||||||
@ -125,7 +124,7 @@ class CreateAggregate(command.ShowOne):
|
|||||||
'properties': properties,
|
'properties': properties,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
return zip(*sorted(six.iteritems(info)))
|
return zip(*sorted(info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteAggregate(command.Command):
|
class DeleteAggregate(command.Command):
|
||||||
@ -255,7 +254,7 @@ class RemoveAggregateHost(command.ShowOne):
|
|||||||
'properties': format_columns.DictColumn(info.pop('metadata')),
|
'properties': format_columns.DictColumn(info.pop('metadata')),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
return zip(*sorted(six.iteritems(info)))
|
return zip(*sorted(info.items()))
|
||||||
|
|
||||||
|
|
||||||
class SetAggregate(command.Command):
|
class SetAggregate(command.Command):
|
||||||
@ -372,7 +371,7 @@ class ShowAggregate(command.ShowOne):
|
|||||||
|
|
||||||
info = {}
|
info = {}
|
||||||
info.update(data._info)
|
info.update(data._info)
|
||||||
return zip(*sorted(six.iteritems(info)))
|
return zip(*sorted(info.items()))
|
||||||
|
|
||||||
|
|
||||||
class UnsetAggregate(command.Command):
|
class UnsetAggregate(command.Command):
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
from osc_lib.cli import parseractions
|
from osc_lib.cli import parseractions
|
||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
@ -138,4 +137,4 @@ class ShowConsoleURL(command.ShowOne):
|
|||||||
# handle for different microversion API.
|
# handle for different microversion API.
|
||||||
console_data = data.get('remote_console', data.get('console'))
|
console_data = data.get('remote_console', data.get('console'))
|
||||||
info.update(console_data)
|
info.update(console_data)
|
||||||
return zip(*sorted(six.iteritems(info)))
|
return zip(*sorted(info.items()))
|
||||||
|
@ -22,7 +22,6 @@ from osc_lib.cli import parseractions
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
from openstackclient.identity import common as identity_common
|
from openstackclient.identity import common as identity_common
|
||||||
@ -195,7 +194,7 @@ class CreateFlavor(command.ShowOne):
|
|||||||
flavor_info.pop("links")
|
flavor_info.pop("links")
|
||||||
flavor_info['properties'] = utils.format_dict(flavor.get_keys())
|
flavor_info['properties'] = utils.format_dict(flavor.get_keys())
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(flavor_info)))
|
return zip(*sorted(flavor_info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteFlavor(command.Command):
|
class DeleteFlavor(command.Command):
|
||||||
@ -447,7 +446,7 @@ class ShowFlavor(command.ShowOne):
|
|||||||
|
|
||||||
flavor['properties'] = utils.format_dict(resource_flavor.get_keys())
|
flavor['properties'] = utils.format_dict(resource_flavor.get_keys())
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(flavor)))
|
return zip(*sorted(flavor.items()))
|
||||||
|
|
||||||
|
|
||||||
class UnsetFlavor(command.Command):
|
class UnsetFlavor(command.Command):
|
||||||
|
@ -20,7 +20,6 @@ import re
|
|||||||
from novaclient import exceptions as nova_exceptions
|
from novaclient import exceptions as nova_exceptions
|
||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
@ -126,4 +125,4 @@ class ShowHypervisor(command.ShowOne):
|
|||||||
hypervisor["service_host"] = hypervisor["service"]["host"]
|
hypervisor["service_host"] = hypervisor["service"]["host"]
|
||||||
del hypervisor["service"]
|
del hypervisor["service"]
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(hypervisor)))
|
return zip(*sorted(hypervisor.items()))
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
"""Hypervisor Stats action implementations"""
|
"""Hypervisor Stats action implementations"""
|
||||||
|
|
||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
@ -27,4 +26,4 @@ class ShowHypervisorStats(command.ShowOne):
|
|||||||
compute_client = self.app.client_manager.compute
|
compute_client = self.app.client_manager.compute
|
||||||
hypervisor_stats = compute_client.hypervisors.statistics().to_dict()
|
hypervisor_stats = compute_client.hypervisors.statistics().to_dict()
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(hypervisor_stats)))
|
return zip(*sorted(hypervisor_stats.items()))
|
||||||
|
@ -23,7 +23,6 @@ import sys
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
@ -101,7 +100,7 @@ class CreateKeypair(command.ShowOne):
|
|||||||
del info['public_key']
|
del info['public_key']
|
||||||
if 'private_key' in info:
|
if 'private_key' in info:
|
||||||
del info['private_key']
|
del info['private_key']
|
||||||
return zip(*sorted(six.iteritems(info)))
|
return zip(*sorted(info.items()))
|
||||||
else:
|
else:
|
||||||
sys.stdout.write(keypair.private_key)
|
sys.stdout.write(keypair.private_key)
|
||||||
return ({}, {})
|
return ({}, {})
|
||||||
@ -184,7 +183,7 @@ class ShowKeypair(command.ShowOne):
|
|||||||
info.update(keypair._info)
|
info.update(keypair._info)
|
||||||
if not parsed_args.public_key:
|
if not parsed_args.public_key:
|
||||||
del info['public_key']
|
del info['public_key']
|
||||||
return zip(*sorted(six.iteritems(info)))
|
return zip(*sorted(info.items()))
|
||||||
else:
|
else:
|
||||||
# NOTE(dtroyer): a way to get the public key in a similar form
|
# NOTE(dtroyer): a way to get the public key in a similar form
|
||||||
# as the private key in the create command
|
# as the private key in the create command
|
||||||
|
@ -1069,7 +1069,7 @@ class CreateServer(command.ShowOne):
|
|||||||
raise SystemExit
|
raise SystemExit
|
||||||
|
|
||||||
details = _prep_server_detail(compute_client, image_client, server)
|
details = _prep_server_detail(compute_client, image_client, server)
|
||||||
return zip(*sorted(six.iteritems(details)))
|
return zip(*sorted(details.items()))
|
||||||
|
|
||||||
|
|
||||||
class CreateServerDump(command.Command):
|
class CreateServerDump(command.Command):
|
||||||
@ -1967,7 +1967,7 @@ class RebuildServer(command.ShowOne):
|
|||||||
|
|
||||||
details = _prep_server_detail(compute_client, image_client, server,
|
details = _prep_server_detail(compute_client, image_client, server,
|
||||||
refresh=False)
|
refresh=False)
|
||||||
return zip(*sorted(six.iteritems(details)))
|
return zip(*sorted(details.items()))
|
||||||
|
|
||||||
|
|
||||||
class RemoveFixedIP(command.Command):
|
class RemoveFixedIP(command.Command):
|
||||||
@ -2537,7 +2537,7 @@ class ShowServer(command.ShowOne):
|
|||||||
self.app.client_manager.image, server,
|
self.app.client_manager.image, server,
|
||||||
refresh=False)
|
refresh=False)
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(data)))
|
return zip(*sorted(data.items()))
|
||||||
|
|
||||||
|
|
||||||
class SshServer(command.Command):
|
class SshServer(command.Command):
|
||||||
|
@ -19,7 +19,6 @@ from osc_lib.command import command
|
|||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
from oslo_utils import importutils
|
from oslo_utils import importutils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
@ -129,4 +128,4 @@ class CreateServerBackup(command.ShowOne):
|
|||||||
]
|
]
|
||||||
)
|
)
|
||||||
info = image_module._format_image(image)
|
info = image_module._format_image(image)
|
||||||
return zip(*sorted(six.iteritems(info)))
|
return zip(*sorted(info.items()))
|
||||||
|
@ -19,7 +19,6 @@ import logging
|
|||||||
|
|
||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
@ -122,4 +121,4 @@ class ShowServerEvent(command.ShowOne):
|
|||||||
action_detail = compute_client.instance_action.get(
|
action_detail = compute_client.instance_action.get(
|
||||||
server_id, parsed_args.request_id)
|
server_id, parsed_args.request_id)
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(action_detail.to_dict())))
|
return zip(*sorted(action_detail.to_dict().items()))
|
||||||
|
@ -21,7 +21,6 @@ from osc_lib.command import command
|
|||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
from oslo_utils import importutils
|
from oslo_utils import importutils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
@ -109,4 +108,4 @@ class CreateServerImage(command.ShowOne):
|
|||||||
]
|
]
|
||||||
)
|
)
|
||||||
info = image_module._format_image(image)
|
info = image_module._format_image(image)
|
||||||
return zip(*sorted(six.iteritems(info)))
|
return zip(*sorted(info.items()))
|
||||||
|
@ -21,7 +21,6 @@ import datetime
|
|||||||
from novaclient import api_versions
|
from novaclient import api_versions
|
||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
@ -236,4 +235,4 @@ class ShowUsage(command.ShowOne):
|
|||||||
info['Disk GB-Hours'] = (
|
info['Disk GB-Hours'] = (
|
||||||
float("%.2f" % usage.total_local_gb_usage)
|
float("%.2f" % usage.total_local_gb_usage)
|
||||||
if hasattr(usage, "total_local_gb_usage") else None)
|
if hasattr(usage, "total_local_gb_usage") else None)
|
||||||
return zip(*sorted(six.iteritems(info)))
|
return zip(*sorted(info.items()))
|
||||||
|
@ -19,7 +19,6 @@ from cliff import columns as cliff_columns
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
@ -102,4 +101,4 @@ class ShowCatalog(command.ShowOne):
|
|||||||
LOG.error(_('service %s not found\n'), parsed_args.service)
|
LOG.error(_('service %s not found\n'), parsed_args.service)
|
||||||
return ((), ())
|
return ((), ())
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(data)))
|
return zip(*sorted(data.items()))
|
||||||
|
@ -21,7 +21,6 @@ import logging
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
@ -82,7 +81,7 @@ class CreateEC2Creds(command.ShowOne):
|
|||||||
{'project_id': info.pop('tenant_id')}
|
{'project_id': info.pop('tenant_id')}
|
||||||
)
|
)
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(info)))
|
return zip(*sorted(info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteEC2Creds(command.Command):
|
class DeleteEC2Creds(command.Command):
|
||||||
@ -206,4 +205,4 @@ class ShowEC2Creds(command.ShowOne):
|
|||||||
{'project_id': info.pop('tenant_id')}
|
{'project_id': info.pop('tenant_id')}
|
||||||
)
|
)
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(info)))
|
return zip(*sorted(info.items()))
|
||||||
|
@ -20,7 +20,6 @@ import logging
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
from openstackclient.identity import common
|
from openstackclient.identity import common
|
||||||
@ -76,7 +75,7 @@ class CreateEndpoint(command.ShowOne):
|
|||||||
info.update(endpoint._info)
|
info.update(endpoint._info)
|
||||||
info['service_name'] = service.name
|
info['service_name'] = service.name
|
||||||
info['service_type'] = service.type
|
info['service_type'] = service.type
|
||||||
return zip(*sorted(six.iteritems(info)))
|
return zip(*sorted(info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteEndpoint(command.Command):
|
class DeleteEndpoint(command.Command):
|
||||||
@ -178,4 +177,4 @@ class ShowEndpoint(command.ShowOne):
|
|||||||
info.update(match._info)
|
info.update(match._info)
|
||||||
info['service_name'] = service.name
|
info['service_name'] = service.name
|
||||||
info['service_type'] = service.type
|
info['service_type'] = service.type
|
||||||
return zip(*sorted(six.iteritems(info)))
|
return zip(*sorted(info.items()))
|
||||||
|
@ -23,7 +23,6 @@ from osc_lib.cli import parseractions
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
@ -100,7 +99,7 @@ class CreateProject(command.ShowOne):
|
|||||||
|
|
||||||
# TODO(stevemar): Remove the line below when we support multitenancy
|
# TODO(stevemar): Remove the line below when we support multitenancy
|
||||||
project._info.pop('parent_id', None)
|
project._info.pop('parent_id', None)
|
||||||
return zip(*sorted(six.iteritems(project._info)))
|
return zip(*sorted(project._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteProject(command.Command):
|
class DeleteProject(command.Command):
|
||||||
@ -299,7 +298,7 @@ class ShowProject(command.ShowOne):
|
|||||||
properties[k] = v
|
properties[k] = v
|
||||||
|
|
||||||
info['properties'] = format_columns.DictColumn(properties)
|
info['properties'] = format_columns.DictColumn(properties)
|
||||||
return zip(*sorted(six.iteritems(info)))
|
return zip(*sorted(info.items()))
|
||||||
|
|
||||||
|
|
||||||
class UnsetProject(command.Command):
|
class UnsetProject(command.Command):
|
||||||
|
@ -21,7 +21,6 @@ from keystoneauth1 import exceptions as ks_exc
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
@ -69,7 +68,7 @@ class AddRole(command.ShowOne):
|
|||||||
|
|
||||||
info = {}
|
info = {}
|
||||||
info.update(role._info)
|
info.update(role._info)
|
||||||
return zip(*sorted(six.iteritems(info)))
|
return zip(*sorted(info.items()))
|
||||||
|
|
||||||
|
|
||||||
class CreateRole(command.ShowOne):
|
class CreateRole(command.ShowOne):
|
||||||
@ -105,7 +104,7 @@ class CreateRole(command.ShowOne):
|
|||||||
|
|
||||||
info = {}
|
info = {}
|
||||||
info.update(role._info)
|
info.update(role._info)
|
||||||
return zip(*sorted(six.iteritems(info)))
|
return zip(*sorted(info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteRole(command.Command):
|
class DeleteRole(command.Command):
|
||||||
@ -217,4 +216,4 @@ class ShowRole(command.ShowOne):
|
|||||||
|
|
||||||
info = {}
|
info = {}
|
||||||
info.update(role._info)
|
info.update(role._info)
|
||||||
return zip(*sorted(six.iteritems(info)))
|
return zip(*sorted(info.items()))
|
||||||
|
@ -20,7 +20,6 @@ import logging
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
from openstackclient.identity import common
|
from openstackclient.identity import common
|
||||||
@ -65,7 +64,7 @@ class CreateService(command.ShowOne):
|
|||||||
|
|
||||||
info = {}
|
info = {}
|
||||||
info.update(service._info)
|
info.update(service._info)
|
||||||
return zip(*sorted(six.iteritems(info)))
|
return zip(*sorted(info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteService(command.Command):
|
class DeleteService(command.Command):
|
||||||
@ -153,11 +152,11 @@ class ShowService(command.ShowOne):
|
|||||||
if parsed_args.catalog:
|
if parsed_args.catalog:
|
||||||
endpoints = auth_ref.service_catalog.get_endpoints(
|
endpoints = auth_ref.service_catalog.get_endpoints(
|
||||||
service_type=parsed_args.service)
|
service_type=parsed_args.service)
|
||||||
for (service, service_endpoints) in six.iteritems(endpoints):
|
for (service, service_endpoints) in endpoints.items():
|
||||||
if service_endpoints:
|
if service_endpoints:
|
||||||
info = {"type": service}
|
info = {"type": service}
|
||||||
info.update(service_endpoints[0])
|
info.update(service_endpoints[0])
|
||||||
return zip(*sorted(six.iteritems(info)))
|
return zip(*sorted(info.items()))
|
||||||
|
|
||||||
msg = _("No service catalog with a type, name or ID of '%s' "
|
msg = _("No service catalog with a type, name or ID of '%s' "
|
||||||
"exists.") % (parsed_args.service)
|
"exists.") % (parsed_args.service)
|
||||||
@ -166,4 +165,4 @@ class ShowService(command.ShowOne):
|
|||||||
service = common.find_service(identity_client, parsed_args.service)
|
service = common.find_service(identity_client, parsed_args.service)
|
||||||
info = {}
|
info = {}
|
||||||
info.update(service._info)
|
info.update(service._info)
|
||||||
return zip(*sorted(six.iteritems(info)))
|
return zip(*sorted(info.items()))
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
@ -49,7 +48,7 @@ class IssueToken(command.ShowOne):
|
|||||||
data['project_id'] = auth_ref.project_id
|
data['project_id'] = auth_ref.project_id
|
||||||
if auth_ref.user_id:
|
if auth_ref.user_id:
|
||||||
data['user_id'] = auth_ref.user_id
|
data['user_id'] = auth_ref.user_id
|
||||||
return zip(*sorted(six.iteritems(data)))
|
return zip(*sorted(data.items()))
|
||||||
|
|
||||||
|
|
||||||
class RevokeToken(command.Command):
|
class RevokeToken(command.Command):
|
||||||
|
@ -23,7 +23,6 @@ from keystoneauth1 import exceptions as ks_exc
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
@ -154,7 +153,7 @@ class CreateUser(command.ShowOne):
|
|||||||
|
|
||||||
info = {}
|
info = {}
|
||||||
info.update(user._info)
|
info.update(user._info)
|
||||||
return zip(*sorted(six.iteritems(info)))
|
return zip(*sorted(info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteUser(command.Command):
|
class DeleteUser(command.Command):
|
||||||
@ -418,4 +417,4 @@ class ShowUser(command.ShowOne):
|
|||||||
{'project_id': info.pop('tenant_id')}
|
{'project_id': info.pop('tenant_id')}
|
||||||
)
|
)
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(info)))
|
return zip(*sorted(info.items()))
|
||||||
|
@ -21,7 +21,6 @@ import logging
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
from openstackclient.identity import common
|
from openstackclient.identity import common
|
||||||
@ -123,7 +122,7 @@ class CreateApplicationCredential(command.ShowOne):
|
|||||||
msg = ' '.join(r['name'] for r in roles)
|
msg = ' '.join(r['name'] for r in roles)
|
||||||
application_credential._info['roles'] = msg
|
application_credential._info['roles'] = msg
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(application_credential._info)))
|
return zip(*sorted(application_credential._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteApplicationCredential(command.Command):
|
class DeleteApplicationCredential(command.Command):
|
||||||
@ -217,4 +216,4 @@ class ShowApplicationCredential(command.ShowOne):
|
|||||||
msg = ' '.join(r['name'] for r in roles)
|
msg = ' '.join(r['name'] for r in roles)
|
||||||
app_cred._info['roles'] = msg
|
app_cred._info['roles'] = msg
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(app_cred._info)))
|
return zip(*sorted(app_cred._info.items()))
|
||||||
|
@ -19,7 +19,6 @@ from cliff import columns as cliff_columns
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
@ -97,4 +96,4 @@ class ShowCatalog(command.ShowOne):
|
|||||||
LOG.error(_('service %s not found\n'), parsed_args.service)
|
LOG.error(_('service %s not found\n'), parsed_args.service)
|
||||||
return ((), ())
|
return ((), ())
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(data)))
|
return zip(*sorted(data.items()))
|
||||||
|
@ -20,7 +20,6 @@ import logging
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
@ -46,7 +45,7 @@ class CreateConsumer(command.ShowOne):
|
|||||||
parsed_args.description
|
parsed_args.description
|
||||||
)
|
)
|
||||||
consumer._info.pop('links', None)
|
consumer._info.pop('links', None)
|
||||||
return zip(*sorted(six.iteritems(consumer._info)))
|
return zip(*sorted(consumer._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteConsumer(command.Command):
|
class DeleteConsumer(command.Command):
|
||||||
@ -142,4 +141,4 @@ class ShowConsumer(command.ShowOne):
|
|||||||
identity_client.oauth1.consumers, parsed_args.consumer)
|
identity_client.oauth1.consumers, parsed_args.consumer)
|
||||||
|
|
||||||
consumer._info.pop('links', None)
|
consumer._info.pop('links', None)
|
||||||
return zip(*sorted(six.iteritems(consumer._info)))
|
return zip(*sorted(consumer._info.items()))
|
||||||
|
@ -20,7 +20,6 @@ import logging
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
from openstackclient.identity import common
|
from openstackclient.identity import common
|
||||||
@ -74,7 +73,7 @@ class CreateCredential(command.ShowOne):
|
|||||||
project=project)
|
project=project)
|
||||||
|
|
||||||
credential._info.pop('links')
|
credential._info.pop('links')
|
||||||
return zip(*sorted(six.iteritems(credential._info)))
|
return zip(*sorted(credential._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteCredential(command.Command):
|
class DeleteCredential(command.Command):
|
||||||
@ -225,4 +224,4 @@ class ShowCredential(command.ShowOne):
|
|||||||
parsed_args.credential)
|
parsed_args.credential)
|
||||||
|
|
||||||
credential._info.pop('links')
|
credential._info.pop('links')
|
||||||
return zip(*sorted(six.iteritems(credential._info)))
|
return zip(*sorted(credential._info.items()))
|
||||||
|
@ -21,7 +21,6 @@ from keystoneauth1 import exceptions as ks_exc
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
from openstackclient.identity import common
|
from openstackclient.identity import common
|
||||||
@ -85,7 +84,7 @@ class CreateDomain(command.ShowOne):
|
|||||||
raise
|
raise
|
||||||
|
|
||||||
domain._info.pop('links')
|
domain._info.pop('links')
|
||||||
return zip(*sorted(six.iteritems(domain._info)))
|
return zip(*sorted(domain._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteDomain(command.Command):
|
class DeleteDomain(command.Command):
|
||||||
@ -206,4 +205,4 @@ class ShowDomain(command.ShowOne):
|
|||||||
domain_str)
|
domain_str)
|
||||||
|
|
||||||
domain._info.pop('links')
|
domain._info.pop('links')
|
||||||
return zip(*sorted(six.iteritems(domain._info)))
|
return zip(*sorted(domain._info.items()))
|
||||||
|
@ -17,7 +17,6 @@ import logging
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
from openstackclient.identity import common
|
from openstackclient.identity import common
|
||||||
@ -108,7 +107,7 @@ class CreateEC2Creds(command.ShowOne):
|
|||||||
{'project_id': info.pop('tenant_id')}
|
{'project_id': info.pop('tenant_id')}
|
||||||
)
|
)
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(info)))
|
return zip(*sorted(info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteEC2Creds(command.Command):
|
class DeleteEC2Creds(command.Command):
|
||||||
@ -209,4 +208,4 @@ class ShowEC2Creds(command.ShowOne):
|
|||||||
{'project_id': info.pop('tenant_id')}
|
{'project_id': info.pop('tenant_id')}
|
||||||
)
|
)
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(info)))
|
return zip(*sorted(info.items()))
|
||||||
|
@ -20,7 +20,6 @@ import logging
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
from openstackclient.identity import common
|
from openstackclient.identity import common
|
||||||
@ -131,7 +130,7 @@ class CreateEndpoint(command.ShowOne):
|
|||||||
info.update(endpoint._info)
|
info.update(endpoint._info)
|
||||||
info['service_name'] = get_service_name(service)
|
info['service_name'] = get_service_name(service)
|
||||||
info['service_type'] = service.type
|
info['service_type'] = service.type
|
||||||
return zip(*sorted(six.iteritems(info)))
|
return zip(*sorted(info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteEndpoint(command.Command):
|
class DeleteEndpoint(command.Command):
|
||||||
@ -389,4 +388,4 @@ class ShowEndpoint(command.ShowOne):
|
|||||||
info.update(endpoint._info)
|
info.update(endpoint._info)
|
||||||
info['service_name'] = get_service_name(service)
|
info['service_name'] = get_service_name(service)
|
||||||
info['service_type'] = service.type
|
info['service_type'] = service.type
|
||||||
return zip(*sorted(six.iteritems(info)))
|
return zip(*sorted(info.items()))
|
||||||
|
@ -19,7 +19,6 @@ import logging
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
from openstackclient.identity import common
|
from openstackclient.identity import common
|
||||||
@ -129,7 +128,7 @@ class CreateEndpointGroup(command.ShowOne, _FiltersReader):
|
|||||||
info = {}
|
info = {}
|
||||||
endpoint_group._info.pop('links')
|
endpoint_group._info.pop('links')
|
||||||
info.update(endpoint_group._info)
|
info.update(endpoint_group._info)
|
||||||
return zip(*sorted(six.iteritems(info)))
|
return zip(*sorted(info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteEndpointGroup(command.Command):
|
class DeleteEndpointGroup(command.Command):
|
||||||
@ -321,4 +320,4 @@ class ShowEndpointGroup(command.ShowOne):
|
|||||||
info = {}
|
info = {}
|
||||||
endpoint_group._info.pop('links')
|
endpoint_group._info.pop('links')
|
||||||
info.update(endpoint_group._info)
|
info.update(endpoint_group._info)
|
||||||
return zip(*sorted(six.iteritems(info)))
|
return zip(*sorted(info.items()))
|
||||||
|
@ -19,7 +19,6 @@ import logging
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
@ -68,7 +67,7 @@ class CreateProtocol(command.ShowOne):
|
|||||||
info['identity_provider'] = parsed_args.identity_provider
|
info['identity_provider'] = parsed_args.identity_provider
|
||||||
info['mapping'] = info.pop('mapping_id')
|
info['mapping'] = info.pop('mapping_id')
|
||||||
info.pop('links', None)
|
info.pop('links', None)
|
||||||
return zip(*sorted(six.iteritems(info)))
|
return zip(*sorted(info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteProtocol(command.Command):
|
class DeleteProtocol(command.Command):
|
||||||
@ -175,7 +174,7 @@ class SetProtocol(command.Command):
|
|||||||
# user.
|
# user.
|
||||||
info['identity_provider'] = parsed_args.identity_provider
|
info['identity_provider'] = parsed_args.identity_provider
|
||||||
info['mapping'] = info.pop('mapping_id')
|
info['mapping'] = info.pop('mapping_id')
|
||||||
return zip(*sorted(six.iteritems(info)))
|
return zip(*sorted(info.items()))
|
||||||
|
|
||||||
|
|
||||||
class ShowProtocol(command.ShowOne):
|
class ShowProtocol(command.ShowOne):
|
||||||
@ -205,4 +204,4 @@ class ShowProtocol(command.ShowOne):
|
|||||||
info = dict(protocol._info)
|
info = dict(protocol._info)
|
||||||
info['mapping'] = info.pop('mapping_id')
|
info['mapping'] = info.pop('mapping_id')
|
||||||
info.pop('links', None)
|
info.pop('links', None)
|
||||||
return zip(*sorted(six.iteritems(info)))
|
return zip(*sorted(info.items()))
|
||||||
|
@ -21,7 +21,6 @@ from keystoneauth1 import exceptions as ks_exc
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
from openstackclient.identity import common
|
from openstackclient.identity import common
|
||||||
@ -182,7 +181,7 @@ class CreateGroup(command.ShowOne):
|
|||||||
raise
|
raise
|
||||||
|
|
||||||
group._info.pop('links')
|
group._info.pop('links')
|
||||||
return zip(*sorted(six.iteritems(group._info)))
|
return zip(*sorted(group._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteGroup(command.Command):
|
class DeleteGroup(command.Command):
|
||||||
@ -405,4 +404,4 @@ class ShowGroup(command.ShowOne):
|
|||||||
domain_name_or_id=parsed_args.domain)
|
domain_name_or_id=parsed_args.domain)
|
||||||
|
|
||||||
group._info.pop('links')
|
group._info.pop('links')
|
||||||
return zip(*sorted(six.iteritems(group._info)))
|
return zip(*sorted(group._info.items()))
|
||||||
|
@ -19,7 +19,6 @@ from osc_lib.cli import format_columns
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
from openstackclient.identity import common
|
from openstackclient.identity import common
|
||||||
@ -106,7 +105,7 @@ class CreateIdentityProvider(command.ShowOne):
|
|||||||
idp._info.pop('links', None)
|
idp._info.pop('links', None)
|
||||||
remote_ids = format_columns.ListColumn(idp._info.pop('remote_ids', []))
|
remote_ids = format_columns.ListColumn(idp._info.pop('remote_ids', []))
|
||||||
idp._info['remote_ids'] = remote_ids
|
idp._info['remote_ids'] = remote_ids
|
||||||
return zip(*sorted(six.iteritems(idp._info)))
|
return zip(*sorted(idp._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteIdentityProvider(command.Command):
|
class DeleteIdentityProvider(command.Command):
|
||||||
@ -248,4 +247,4 @@ class ShowIdentityProvider(command.ShowOne):
|
|||||||
idp._info.pop('links', None)
|
idp._info.pop('links', None)
|
||||||
remote_ids = format_columns.ListColumn(idp._info.pop('remote_ids', []))
|
remote_ids = format_columns.ListColumn(idp._info.pop('remote_ids', []))
|
||||||
idp._info['remote_ids'] = remote_ids
|
idp._info['remote_ids'] = remote_ids
|
||||||
return zip(*sorted(six.iteritems(idp._info)))
|
return zip(*sorted(idp._info.items()))
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
@ -75,7 +74,7 @@ class CreateImpliedRole(command.ShowOne):
|
|||||||
prior_role_id, implied_role_id)
|
prior_role_id, implied_role_id)
|
||||||
response._info.pop('links', None)
|
response._info.pop('links', None)
|
||||||
return zip(*sorted([(k, v['id'])
|
return zip(*sorted([(k, v['id'])
|
||||||
for k, v in six.iteritems(response._info)]))
|
for k, v in response._info.items()]))
|
||||||
|
|
||||||
|
|
||||||
class DeleteImpliedRole(command.Command):
|
class DeleteImpliedRole(command.Command):
|
||||||
|
@ -18,7 +18,6 @@ import logging
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
from openstackclient.identity import common as common_utils
|
from openstackclient.identity import common as common_utils
|
||||||
@ -102,7 +101,7 @@ class CreateLimit(command.ShowOne):
|
|||||||
)
|
)
|
||||||
|
|
||||||
limit._info.pop('links', None)
|
limit._info.pop('links', None)
|
||||||
return zip(*sorted(six.iteritems(limit._info)))
|
return zip(*sorted(limit._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class ListLimit(command.Lister):
|
class ListLimit(command.Lister):
|
||||||
@ -198,7 +197,7 @@ class ShowLimit(command.ShowOne):
|
|||||||
identity_client = self.app.client_manager.identity
|
identity_client = self.app.client_manager.identity
|
||||||
limit = identity_client.limits.get(parsed_args.limit_id)
|
limit = identity_client.limits.get(parsed_args.limit_id)
|
||||||
limit._info.pop('links', None)
|
limit._info.pop('links', None)
|
||||||
return zip(*sorted(six.iteritems(limit._info)))
|
return zip(*sorted(limit._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class SetLimit(command.ShowOne):
|
class SetLimit(command.ShowOne):
|
||||||
@ -236,7 +235,7 @@ class SetLimit(command.ShowOne):
|
|||||||
|
|
||||||
limit._info.pop('links', None)
|
limit._info.pop('links', None)
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(limit._info)))
|
return zip(*sorted(limit._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteLimit(command.Command):
|
class DeleteLimit(command.Command):
|
||||||
|
@ -21,7 +21,6 @@ import logging
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
@ -107,7 +106,7 @@ class CreateMapping(command.ShowOne, _RulesReader):
|
|||||||
rules=rules)
|
rules=rules)
|
||||||
|
|
||||||
mapping._info.pop('links', None)
|
mapping._info.pop('links', None)
|
||||||
return zip(*sorted(six.iteritems(mapping._info)))
|
return zip(*sorted(mapping._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteMapping(command.Command):
|
class DeleteMapping(command.Command):
|
||||||
@ -202,4 +201,4 @@ class ShowMapping(command.ShowOne):
|
|||||||
mapping = identity_client.federation.mappings.get(parsed_args.mapping)
|
mapping = identity_client.federation.mappings.get(parsed_args.mapping)
|
||||||
|
|
||||||
mapping._info.pop('links', None)
|
mapping._info.pop('links', None)
|
||||||
return zip(*sorted(six.iteritems(mapping._info)))
|
return zip(*sorted(mapping._info.items()))
|
||||||
|
@ -20,7 +20,6 @@ import logging
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
@ -57,7 +56,7 @@ class CreatePolicy(command.ShowOne):
|
|||||||
|
|
||||||
policy._info.pop('links')
|
policy._info.pop('links')
|
||||||
policy._info.update({'rules': policy._info.pop('blob')})
|
policy._info.update({'rules': policy._info.pop('blob')})
|
||||||
return zip(*sorted(six.iteritems(policy._info)))
|
return zip(*sorted(policy._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeletePolicy(command.Command):
|
class DeletePolicy(command.Command):
|
||||||
@ -176,4 +175,4 @@ class ShowPolicy(command.ShowOne):
|
|||||||
|
|
||||||
policy._info.pop('links')
|
policy._info.pop('links')
|
||||||
policy._info.update({'rules': policy._info.pop('blob')})
|
policy._info.update({'rules': policy._info.pop('blob')})
|
||||||
return zip(*sorted(six.iteritems(policy._info)))
|
return zip(*sorted(policy._info.items()))
|
||||||
|
@ -22,7 +22,6 @@ from osc_lib.cli import parseractions
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
from openstackclient.identity import common
|
from openstackclient.identity import common
|
||||||
@ -124,7 +123,7 @@ class CreateProject(command.ShowOne):
|
|||||||
raise
|
raise
|
||||||
|
|
||||||
project._info.pop('links')
|
project._info.pop('links')
|
||||||
return zip(*sorted(six.iteritems(project._info)))
|
return zip(*sorted(project._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteProject(command.Command):
|
class DeleteProject(command.Command):
|
||||||
@ -401,4 +400,4 @@ class ShowProject(command.ShowOne):
|
|||||||
subtree_as_ids=parsed_args.children)
|
subtree_as_ids=parsed_args.children)
|
||||||
|
|
||||||
project._info.pop('links')
|
project._info.pop('links')
|
||||||
return zip(*sorted(six.iteritems(project._info)))
|
return zip(*sorted(project._info.items()))
|
||||||
|
@ -18,7 +18,6 @@ import logging
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
@ -62,7 +61,7 @@ class CreateRegion(command.ShowOne):
|
|||||||
region._info['region'] = region._info.pop('id')
|
region._info['region'] = region._info.pop('id')
|
||||||
region._info['parent_region'] = region._info.pop('parent_region_id')
|
region._info['parent_region'] = region._info.pop('parent_region_id')
|
||||||
region._info.pop('links', None)
|
region._info.pop('links', None)
|
||||||
return zip(*sorted(six.iteritems(region._info)))
|
return zip(*sorted(region._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteRegion(command.Command):
|
class DeleteRegion(command.Command):
|
||||||
@ -181,4 +180,4 @@ class ShowRegion(command.ShowOne):
|
|||||||
region._info['region'] = region._info.pop('id')
|
region._info['region'] = region._info.pop('id')
|
||||||
region._info['parent_region'] = region._info.pop('parent_region_id')
|
region._info['parent_region'] = region._info.pop('parent_region_id')
|
||||||
region._info.pop('links', None)
|
region._info.pop('links', None)
|
||||||
return zip(*sorted(six.iteritems(region._info)))
|
return zip(*sorted(region._info.items()))
|
||||||
|
@ -18,7 +18,6 @@ import logging
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
from openstackclient.identity import common as common_utils
|
from openstackclient.identity import common as common_utils
|
||||||
@ -92,7 +91,7 @@ class CreateRegisteredLimit(command.ShowOne):
|
|||||||
)
|
)
|
||||||
|
|
||||||
registered_limit._info.pop('links', None)
|
registered_limit._info.pop('links', None)
|
||||||
return zip(*sorted(six.iteritems(registered_limit._info)))
|
return zip(*sorted(registered_limit._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteRegisteredLimit(command.Command):
|
class DeleteRegisteredLimit(command.Command):
|
||||||
@ -275,7 +274,7 @@ class SetRegisteredLimit(command.ShowOne):
|
|||||||
)
|
)
|
||||||
|
|
||||||
registered_limit._info.pop('links', None)
|
registered_limit._info.pop('links', None)
|
||||||
return zip(*sorted(six.iteritems(registered_limit._info)))
|
return zip(*sorted(registered_limit._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class ShowRegisteredLimit(command.ShowOne):
|
class ShowRegisteredLimit(command.ShowOne):
|
||||||
@ -296,4 +295,4 @@ class ShowRegisteredLimit(command.ShowOne):
|
|||||||
parsed_args.registered_limit_id
|
parsed_args.registered_limit_id
|
||||||
)
|
)
|
||||||
registered_limit._info.pop('links', None)
|
registered_limit._info.pop('links', None)
|
||||||
return zip(*sorted(six.iteritems(registered_limit._info)))
|
return zip(*sorted(registered_limit._info.items()))
|
||||||
|
@ -21,7 +21,6 @@ from keystoneauth1 import exceptions as ks_exc
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
from openstackclient.identity import common
|
from openstackclient.identity import common
|
||||||
@ -211,7 +210,7 @@ class CreateRole(command.ShowOne):
|
|||||||
raise
|
raise
|
||||||
|
|
||||||
role._info.pop('links')
|
role._info.pop('links')
|
||||||
return zip(*sorted(six.iteritems(role._info)))
|
return zip(*sorted(role._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteRole(command.Command):
|
class DeleteRole(command.Command):
|
||||||
@ -403,4 +402,4 @@ class ShowRole(command.ShowOne):
|
|||||||
domain_id=domain_id)
|
domain_id=domain_id)
|
||||||
|
|
||||||
role._info.pop('links')
|
role._info.pop('links')
|
||||||
return zip(*sorted(six.iteritems(role._info)))
|
return zip(*sorted(role._info.items()))
|
||||||
|
@ -20,7 +20,6 @@ import logging
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
from openstackclient.identity import common
|
from openstackclient.identity import common
|
||||||
@ -77,7 +76,7 @@ class CreateService(command.ShowOne):
|
|||||||
)
|
)
|
||||||
|
|
||||||
service._info.pop('links')
|
service._info.pop('links')
|
||||||
return zip(*sorted(six.iteritems(service._info)))
|
return zip(*sorted(service._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteService(command.Command):
|
class DeleteService(command.Command):
|
||||||
@ -218,4 +217,4 @@ class ShowService(command.ShowOne):
|
|||||||
service = common.find_service(identity_client, parsed_args.service)
|
service = common.find_service(identity_client, parsed_args.service)
|
||||||
|
|
||||||
service._info.pop('links')
|
service._info.pop('links')
|
||||||
return zip(*sorted(six.iteritems(service._info)))
|
return zip(*sorted(service._info.items()))
|
||||||
|
@ -18,7 +18,6 @@ import logging
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
@ -83,7 +82,7 @@ class CreateServiceProvider(command.ShowOne):
|
|||||||
sp_url=parsed_args.service_provider_url)
|
sp_url=parsed_args.service_provider_url)
|
||||||
|
|
||||||
sp._info.pop('links', None)
|
sp._info.pop('links', None)
|
||||||
return zip(*sorted(six.iteritems(sp._info)))
|
return zip(*sorted(sp._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteServiceProvider(command.Command):
|
class DeleteServiceProvider(command.Command):
|
||||||
@ -211,4 +210,4 @@ class ShowServiceProvider(command.ShowOne):
|
|||||||
id=parsed_args.service_provider)
|
id=parsed_args.service_provider)
|
||||||
|
|
||||||
service_provider._info.pop('links', None)
|
service_provider._info.pop('links', None)
|
||||||
return zip(*sorted(six.iteritems(service_provider._info)))
|
return zip(*sorted(service_provider._info.items()))
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
from openstackclient.identity import common
|
from openstackclient.identity import common
|
||||||
@ -62,7 +61,7 @@ class AuthorizeRequestToken(command.ShowOne):
|
|||||||
parsed_args.request_key,
|
parsed_args.request_key,
|
||||||
roles)
|
roles)
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(verifier_pin._info)))
|
return zip(*sorted(verifier_pin._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class CreateAccessToken(command.ShowOne):
|
class CreateAccessToken(command.ShowOne):
|
||||||
@ -108,7 +107,7 @@ class CreateAccessToken(command.ShowOne):
|
|||||||
parsed_args.consumer_key, parsed_args.consumer_secret,
|
parsed_args.consumer_key, parsed_args.consumer_secret,
|
||||||
parsed_args.request_key, parsed_args.request_secret,
|
parsed_args.request_key, parsed_args.request_secret,
|
||||||
parsed_args.verifier)
|
parsed_args.verifier)
|
||||||
return zip(*sorted(six.iteritems(access_token._info)))
|
return zip(*sorted(access_token._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class CreateRequestToken(command.ShowOne):
|
class CreateRequestToken(command.ShowOne):
|
||||||
@ -160,7 +159,7 @@ class CreateRequestToken(command.ShowOne):
|
|||||||
parsed_args.consumer_key,
|
parsed_args.consumer_key,
|
||||||
parsed_args.consumer_secret,
|
parsed_args.consumer_secret,
|
||||||
project.id)
|
project.id)
|
||||||
return zip(*sorted(six.iteritems(request_token._info)))
|
return zip(*sorted(request_token._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class IssueToken(command.ShowOne):
|
class IssueToken(command.ShowOne):
|
||||||
@ -198,7 +197,7 @@ class IssueToken(command.ShowOne):
|
|||||||
# deployment system. When that happens, this will have to relay
|
# deployment system. When that happens, this will have to relay
|
||||||
# scope information and IDs like we do for projects and domains.
|
# scope information and IDs like we do for projects and domains.
|
||||||
data['system'] = 'all'
|
data['system'] = 'all'
|
||||||
return zip(*sorted(six.iteritems(data)))
|
return zip(*sorted(data.items()))
|
||||||
|
|
||||||
|
|
||||||
class RevokeToken(command.Command):
|
class RevokeToken(command.Command):
|
||||||
|
@ -20,7 +20,6 @@ from keystoneclient import exceptions as identity_exc
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
from openstackclient.identity import common
|
from openstackclient.identity import common
|
||||||
@ -136,7 +135,7 @@ class CreateTrust(command.ShowOne):
|
|||||||
msg = ' '.join(r['name'] for r in roles)
|
msg = ' '.join(r['name'] for r in roles)
|
||||||
trust._info['roles'] = msg
|
trust._info['roles'] = msg
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(trust._info)))
|
return zip(*sorted(trust._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteTrust(command.Command):
|
class DeleteTrust(command.Command):
|
||||||
@ -213,4 +212,4 @@ class ShowTrust(command.ShowOne):
|
|||||||
msg = ' '.join(r['name'] for r in roles)
|
msg = ' '.join(r['name'] for r in roles)
|
||||||
trust._info['roles'] = msg
|
trust._info['roles'] = msg
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(trust._info)))
|
return zip(*sorted(trust._info.items()))
|
||||||
|
@ -22,7 +22,6 @@ from keystoneauth1 import exceptions as ks_exc
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
from openstackclient.identity import common
|
from openstackclient.identity import common
|
||||||
@ -135,7 +134,7 @@ class CreateUser(command.ShowOne):
|
|||||||
raise
|
raise
|
||||||
|
|
||||||
user._info.pop('links')
|
user._info.pop('links')
|
||||||
return zip(*sorted(six.iteritems(user._info)))
|
return zip(*sorted(user._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteUser(command.Command):
|
class DeleteUser(command.Command):
|
||||||
@ -486,4 +485,4 @@ class ShowUser(command.ShowOne):
|
|||||||
user_str)
|
user_str)
|
||||||
|
|
||||||
user._info.pop('links')
|
user._info.pop('links')
|
||||||
return zip(*sorted(six.iteritems(user._info)))
|
return zip(*sorted(user._info.items()))
|
||||||
|
@ -28,7 +28,6 @@ from osc_lib.cli import format_columns
|
|||||||
from osc_lib.cli import parseractions
|
from osc_lib.cli import parseractions
|
||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
@ -271,7 +270,7 @@ class CreateImage(command.ShowOne):
|
|||||||
info.update(image._info)
|
info.update(image._info)
|
||||||
info['properties'] = format_columns.DictColumn(
|
info['properties'] = format_columns.DictColumn(
|
||||||
info.get('properties', {}))
|
info.get('properties', {}))
|
||||||
return zip(*sorted(six.iteritems(info)))
|
return zip(*sorted(info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteImage(command.Command):
|
class DeleteImage(command.Command):
|
||||||
@ -718,4 +717,4 @@ class ShowImage(command.ShowOne):
|
|||||||
info['size'] = utils.format_size(info['size'])
|
info['size'] = utils.format_size(info['size'])
|
||||||
info['properties'] = format_columns.DictColumn(
|
info['properties'] = format_columns.DictColumn(
|
||||||
info.get('properties', {}))
|
info.get('properties', {}))
|
||||||
return zip(*sorted(six.iteritems(info)))
|
return zip(*sorted(info.items()))
|
||||||
|
@ -110,7 +110,7 @@ class AddProjectToImage(command.ShowOne):
|
|||||||
project_id,
|
project_id,
|
||||||
)
|
)
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(image_member)))
|
return zip(*sorted(image_member.items()))
|
||||||
|
|
||||||
|
|
||||||
class CreateImage(command.ShowOne):
|
class CreateImage(command.ShowOne):
|
||||||
@ -292,7 +292,7 @@ class CreateImage(command.ShowOne):
|
|||||||
|
|
||||||
# properties should get flattened into the general kwargs
|
# properties should get flattened into the general kwargs
|
||||||
if getattr(parsed_args, 'properties', None):
|
if getattr(parsed_args, 'properties', None):
|
||||||
for k, v in six.iteritems(parsed_args.properties):
|
for k, v in parsed_args.properties.items():
|
||||||
kwargs[k] = str(v)
|
kwargs[k] = str(v)
|
||||||
|
|
||||||
# Handle exclusive booleans with care
|
# Handle exclusive booleans with care
|
||||||
@ -417,7 +417,7 @@ class CreateImage(command.ShowOne):
|
|||||||
if not info:
|
if not info:
|
||||||
info = _format_image(image)
|
info = _format_image(image)
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(info)))
|
return zip(*sorted(info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteImage(command.Command):
|
class DeleteImage(command.Command):
|
||||||
@ -969,7 +969,7 @@ class SetImage(command.Command):
|
|||||||
|
|
||||||
# Properties should get flattened into the general kwargs
|
# Properties should get flattened into the general kwargs
|
||||||
if getattr(parsed_args, 'properties', None):
|
if getattr(parsed_args, 'properties', None):
|
||||||
for k, v in six.iteritems(parsed_args.properties):
|
for k, v in parsed_args.properties.items():
|
||||||
kwargs[k] = str(v)
|
kwargs[k] = str(v)
|
||||||
|
|
||||||
# Handle exclusive booleans with care
|
# Handle exclusive booleans with care
|
||||||
@ -1066,7 +1066,7 @@ class ShowImage(command.ShowOne):
|
|||||||
image['size'] = utils.format_size(image['size'])
|
image['size'] = utils.format_size(image['size'])
|
||||||
|
|
||||||
info = _format_image(image)
|
info = _format_image(image)
|
||||||
return zip(*sorted(six.iteritems(info)))
|
return zip(*sorted(info.items()))
|
||||||
|
|
||||||
|
|
||||||
class UnsetImage(command.Command):
|
class UnsetImage(command.Command):
|
||||||
|
@ -10,8 +10,6 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import six
|
|
||||||
|
|
||||||
|
|
||||||
def get_osc_show_columns_for_sdk_resource(
|
def get_osc_show_columns_for_sdk_resource(
|
||||||
sdk_resource,
|
sdk_resource,
|
||||||
@ -44,7 +42,7 @@ def get_osc_show_columns_for_sdk_resource(
|
|||||||
for col_name in invisible_columns:
|
for col_name in invisible_columns:
|
||||||
if col_name in display_columns:
|
if col_name in display_columns:
|
||||||
display_columns.remove(col_name)
|
display_columns.remove(col_name)
|
||||||
for sdk_attr, osc_attr in six.iteritems(osc_column_map):
|
for sdk_attr, osc_attr in osc_column_map.items():
|
||||||
if sdk_attr in display_columns:
|
if sdk_attr in display_columns:
|
||||||
attr_map[osc_attr] = sdk_attr
|
attr_map[osc_attr] = sdk_attr
|
||||||
display_columns.remove(sdk_attr)
|
display_columns.remove(sdk_attr)
|
||||||
|
@ -61,7 +61,7 @@ def _is_prop_empty(columns, props, prop_name):
|
|||||||
|
|
||||||
def _exchange_dict_keys_with_values(orig_dict):
|
def _exchange_dict_keys_with_values(orig_dict):
|
||||||
updated_dict = dict()
|
updated_dict = dict()
|
||||||
for k, v in six.iteritems(orig_dict):
|
for k, v in orig_dict.items():
|
||||||
k = [k]
|
k = [k]
|
||||||
if not updated_dict.get(v):
|
if not updated_dict.get(v):
|
||||||
updated_dict[v] = k
|
updated_dict[v] = k
|
||||||
@ -80,7 +80,7 @@ def _update_available_from_props(columns, props):
|
|||||||
def _update_used_from_props(columns, props):
|
def _update_used_from_props(columns, props):
|
||||||
index_used = columns.index('used')
|
index_used = columns.index('used')
|
||||||
updated_used = _exchange_dict_keys_with_values(props[index_used])
|
updated_used = _exchange_dict_keys_with_values(props[index_used])
|
||||||
for k, v in six.iteritems(updated_used):
|
for k, v in updated_used.items():
|
||||||
updated_used[k] = list(_get_ranges(v))
|
updated_used[k] = list(_get_ranges(v))
|
||||||
props = _hack_tuple_value_update_by_index(
|
props = _hack_tuple_value_update_by_index(
|
||||||
props, index_used, updated_used)
|
props, index_used, updated_used)
|
||||||
|
@ -19,7 +19,6 @@ from cliff import columns as cliff_columns
|
|||||||
from osc_lib.cli import format_columns
|
from osc_lib.cli import format_columns
|
||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
from openstackclient.identity import common as identity_common
|
from openstackclient.identity import common as identity_common
|
||||||
@ -34,7 +33,7 @@ def _format_network_security_group_rules(sg_rules):
|
|||||||
# rules, trim keys with caller known (e.g. security group and tenant ID)
|
# rules, trim keys with caller known (e.g. security group and tenant ID)
|
||||||
# or empty values.
|
# or empty values.
|
||||||
for sg_rule in sg_rules:
|
for sg_rule in sg_rules:
|
||||||
empty_keys = [k for k, v in six.iteritems(sg_rule) if not v]
|
empty_keys = [k for k, v in sg_rule.items() if not v]
|
||||||
for key in empty_keys:
|
for key in empty_keys:
|
||||||
sg_rule.pop(key)
|
sg_rule.pop(key)
|
||||||
sg_rule.pop('security_group_id', None)
|
sg_rule.pop('security_group_id', None)
|
||||||
|
@ -20,7 +20,6 @@ from osc_lib.cli import format_columns
|
|||||||
from osc_lib.cli import parseractions
|
from osc_lib.cli import parseractions
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
from openstackclient.identity import common as identity_common
|
from openstackclient.identity import common as identity_common
|
||||||
@ -39,7 +38,7 @@ _formatters = {
|
|||||||
|
|
||||||
def _format_security_group_rule_show(obj):
|
def _format_security_group_rule_show(obj):
|
||||||
data = network_utils.transform_compute_security_group_rule(obj)
|
data = network_utils.transform_compute_security_group_rule(obj)
|
||||||
return zip(*sorted(six.iteritems(data)))
|
return zip(*sorted(data.items()))
|
||||||
|
|
||||||
|
|
||||||
def _format_network_port_range(rule):
|
def _format_network_port_range(rule):
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
from osc_lib.cli import format_columns
|
from osc_lib.cli import format_columns
|
||||||
from osc_lib.cli import parseractions
|
from osc_lib.cli import parseractions
|
||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
@ -50,7 +49,7 @@ class ShowAccount(command.ShowOne):
|
|||||||
if 'properties' in data:
|
if 'properties' in data:
|
||||||
data['properties'] = format_columns.DictColumn(
|
data['properties'] = format_columns.DictColumn(
|
||||||
data.pop('properties'))
|
data.pop('properties'))
|
||||||
return zip(*sorted(six.iteritems(data)))
|
return zip(*sorted(data.items()))
|
||||||
|
|
||||||
|
|
||||||
class UnsetAccount(command.Command):
|
class UnsetAccount(command.Command):
|
||||||
|
@ -21,7 +21,6 @@ from osc_lib.cli import format_columns
|
|||||||
from osc_lib.cli import parseractions
|
from osc_lib.cli import parseractions
|
||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
@ -233,7 +232,7 @@ class ShowContainer(command.ShowOne):
|
|||||||
if 'properties' in data:
|
if 'properties' in data:
|
||||||
data['properties'] = format_columns.DictColumn(data['properties'])
|
data['properties'] = format_columns.DictColumn(data['properties'])
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(data)))
|
return zip(*sorted(data.items()))
|
||||||
|
|
||||||
|
|
||||||
class UnsetContainer(command.Command):
|
class UnsetContainer(command.Command):
|
||||||
|
@ -22,7 +22,6 @@ from osc_lib.cli import parseractions
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
@ -287,7 +286,7 @@ class ShowObject(command.ShowOne):
|
|||||||
if 'properties' in data:
|
if 'properties' in data:
|
||||||
data['properties'] = format_columns.DictColumn(data['properties'])
|
data['properties'] = format_columns.DictColumn(data['properties'])
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(data)))
|
return zip(*sorted(data.items()))
|
||||||
|
|
||||||
|
|
||||||
class UnsetObject(command.Command):
|
class UnsetObject(command.Command):
|
||||||
|
@ -13,8 +13,6 @@
|
|||||||
|
|
||||||
import mock
|
import mock
|
||||||
|
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.common import availability_zone
|
from openstackclient.common import availability_zone
|
||||||
from openstackclient.tests.unit.compute.v2 import fakes as compute_fakes
|
from openstackclient.tests.unit.compute.v2 import fakes as compute_fakes
|
||||||
from openstackclient.tests.unit import fakes
|
from openstackclient.tests.unit import fakes
|
||||||
@ -31,8 +29,8 @@ def _build_compute_az_datalist(compute_az, long_datalist=False):
|
|||||||
'available',
|
'available',
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
for host, services in six.iteritems(compute_az.hosts):
|
for host, services in compute_az.hosts.items():
|
||||||
for service, state in six.iteritems(services):
|
for service, state in services.items():
|
||||||
datalist += (
|
datalist += (
|
||||||
compute_az.zoneName,
|
compute_az.zoneName,
|
||||||
'available',
|
'available',
|
||||||
|
@ -200,7 +200,7 @@ class FakeResource(object):
|
|||||||
self._loaded = loaded
|
self._loaded = loaded
|
||||||
|
|
||||||
def _add_details(self, info):
|
def _add_details(self, info):
|
||||||
for (k, v) in six.iteritems(info):
|
for (k, v) in info.items():
|
||||||
setattr(self, k, v)
|
setattr(self, k, v)
|
||||||
|
|
||||||
def _add_methods(self, methods):
|
def _add_methods(self, methods):
|
||||||
@ -211,7 +211,7 @@ class FakeResource(object):
|
|||||||
@value. When users access the attribute with (), @value will be
|
@value. When users access the attribute with (), @value will be
|
||||||
returned, which looks like a function call.
|
returned, which looks like a function call.
|
||||||
"""
|
"""
|
||||||
for (name, ret) in six.iteritems(methods):
|
for (name, ret) in methods.items():
|
||||||
method = mock.Mock(return_value=ret)
|
method = mock.Mock(return_value=ret)
|
||||||
setattr(self, name, method)
|
setattr(self, name, method)
|
||||||
|
|
||||||
|
@ -22,7 +22,6 @@ from osc_lib.cli import parseractions
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
@ -99,7 +98,7 @@ class CreateQos(command.ShowOne):
|
|||||||
{'properties':
|
{'properties':
|
||||||
format_columns.DictColumn(qos_spec._info.pop('specs'))}
|
format_columns.DictColumn(qos_spec._info.pop('specs'))}
|
||||||
)
|
)
|
||||||
return zip(*sorted(six.iteritems(qos_spec._info)))
|
return zip(*sorted(qos_spec._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteQos(command.Command):
|
class DeleteQos(command.Command):
|
||||||
@ -273,7 +272,7 @@ class ShowQos(command.ShowOne):
|
|||||||
{'properties':
|
{'properties':
|
||||||
format_columns.DictColumn(qos_spec._info.pop('specs'))})
|
format_columns.DictColumn(qos_spec._info.pop('specs'))})
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(qos_spec._info)))
|
return zip(*sorted(qos_spec._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class UnsetQos(command.Command):
|
class UnsetQos(command.Command):
|
||||||
|
@ -25,7 +25,6 @@ from osc_lib.cli import parseractions
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
@ -253,7 +252,7 @@ class CreateVolume(command.ShowOne):
|
|||||||
volume._info, parsed_args.columns, {'display_name': 'name'}
|
volume._info, parsed_args.columns, {'display_name': 'name'}
|
||||||
)
|
)
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(volume_info)))
|
return zip(*sorted(volume_info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteVolume(command.Command):
|
class DeleteVolume(command.Command):
|
||||||
@ -614,7 +613,7 @@ class ShowVolume(command.ShowOne):
|
|||||||
volume._info, parsed_args.columns, {'display_name': 'name'}
|
volume._info, parsed_args.columns, {'display_name': 'name'}
|
||||||
)
|
)
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(volume_info)))
|
return zip(*sorted(volume_info.items()))
|
||||||
|
|
||||||
|
|
||||||
class UnsetVolume(command.Command):
|
class UnsetVolume(command.Command):
|
||||||
|
@ -23,7 +23,6 @@ from cliff import columns as cliff_columns
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
@ -98,7 +97,7 @@ class CreateVolumeBackup(command.ShowOne):
|
|||||||
)
|
)
|
||||||
|
|
||||||
backup._info.pop('links')
|
backup._info.pop('links')
|
||||||
return zip(*sorted(six.iteritems(backup._info)))
|
return zip(*sorted(backup._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteVolumeBackup(command.Command):
|
class DeleteVolumeBackup(command.Command):
|
||||||
@ -263,4 +262,4 @@ class ShowVolumeBackup(command.ShowOne):
|
|||||||
backup = utils.find_resource(volume_client.backups,
|
backup = utils.find_resource(volume_client.backups,
|
||||||
parsed_args.backup)
|
parsed_args.backup)
|
||||||
backup._info.pop('links')
|
backup._info.pop('links')
|
||||||
return zip(*sorted(six.iteritems(backup._info)))
|
return zip(*sorted(backup._info.items()))
|
||||||
|
@ -25,7 +25,6 @@ from osc_lib.cli import parseractions
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
@ -110,7 +109,7 @@ class CreateVolumeSnapshot(command.ShowOne):
|
|||||||
format_columns.DictColumn(snapshot._info.pop('metadata'))}
|
format_columns.DictColumn(snapshot._info.pop('metadata'))}
|
||||||
)
|
)
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(snapshot._info)))
|
return zip(*sorted(snapshot._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteVolumeSnapshot(command.Command):
|
class DeleteVolumeSnapshot(command.Command):
|
||||||
@ -342,7 +341,7 @@ class ShowVolumeSnapshot(command.ShowOne):
|
|||||||
format_columns.DictColumn(snapshot._info.pop('metadata'))}
|
format_columns.DictColumn(snapshot._info.pop('metadata'))}
|
||||||
)
|
)
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(snapshot._info)))
|
return zip(*sorted(snapshot._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class UnsetVolumeSnapshot(command.Command):
|
class UnsetVolumeSnapshot(command.Command):
|
||||||
|
@ -19,7 +19,6 @@ import logging
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
@ -67,7 +66,7 @@ class AcceptTransferRequest(command.ShowOne):
|
|||||||
)
|
)
|
||||||
transfer_accept._info.pop("links", None)
|
transfer_accept._info.pop("links", None)
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(transfer_accept._info)))
|
return zip(*sorted(transfer_accept._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class CreateTransferRequest(command.ShowOne):
|
class CreateTransferRequest(command.ShowOne):
|
||||||
@ -99,7 +98,7 @@ class CreateTransferRequest(command.ShowOne):
|
|||||||
)
|
)
|
||||||
volume_transfer_request._info.pop("links", None)
|
volume_transfer_request._info.pop("links", None)
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(volume_transfer_request._info)))
|
return zip(*sorted(volume_transfer_request._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteTransferRequest(command.Command):
|
class DeleteTransferRequest(command.Command):
|
||||||
@ -189,4 +188,4 @@ class ShowTransferRequest(command.ShowOne):
|
|||||||
)
|
)
|
||||||
volume_transfer_request._info.pop("links", None)
|
volume_transfer_request._info.pop("links", None)
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(volume_transfer_request._info)))
|
return zip(*sorted(volume_transfer_request._info.items()))
|
||||||
|
@ -24,7 +24,6 @@ from osc_lib.cli import parseractions
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
@ -162,7 +161,7 @@ class CreateVolumeType(command.ShowOne):
|
|||||||
{'encryption': format_columns.DictColumn(encryption._info)})
|
{'encryption': format_columns.DictColumn(encryption._info)})
|
||||||
volume_type._info.pop("os-volume-type-access:is_public", None)
|
volume_type._info.pop("os-volume-type-access:is_public", None)
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(volume_type._info)))
|
return zip(*sorted(volume_type._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteVolumeType(command.Command):
|
class DeleteVolumeType(command.Command):
|
||||||
@ -388,7 +387,7 @@ class ShowVolumeType(command.ShowOne):
|
|||||||
LOG.error(_("Failed to display the encryption information "
|
LOG.error(_("Failed to display the encryption information "
|
||||||
"of this volume type: %s"), e)
|
"of this volume type: %s"), e)
|
||||||
volume_type._info.pop("os-volume-type-access:is_public", None)
|
volume_type._info.pop("os-volume-type-access:is_public", None)
|
||||||
return zip(*sorted(six.iteritems(volume_type._info)))
|
return zip(*sorted(volume_type._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class UnsetVolumeType(command.Command):
|
class UnsetVolumeType(command.Command):
|
||||||
|
@ -18,7 +18,6 @@ import logging
|
|||||||
|
|
||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
@ -51,7 +50,7 @@ class ExportBackupRecord(command.ShowOne):
|
|||||||
backup_data['Backup Service'] = backup_data.pop('backup_service')
|
backup_data['Backup Service'] = backup_data.pop('backup_service')
|
||||||
backup_data['Metadata'] = backup_data.pop('backup_url')
|
backup_data['Metadata'] = backup_data.pop('backup_url')
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(backup_data)))
|
return zip(*sorted(backup_data.items()))
|
||||||
|
|
||||||
|
|
||||||
class ImportBackupRecord(command.ShowOne):
|
class ImportBackupRecord(command.ShowOne):
|
||||||
@ -79,4 +78,4 @@ class ImportBackupRecord(command.ShowOne):
|
|||||||
parsed_args.backup_service,
|
parsed_args.backup_service,
|
||||||
parsed_args.backup_metadata)
|
parsed_args.backup_metadata)
|
||||||
backup_data.pop('links', None)
|
backup_data.pop('links', None)
|
||||||
return zip(*sorted(six.iteritems(backup_data)))
|
return zip(*sorted(backup_data.items()))
|
||||||
|
@ -20,7 +20,6 @@ from osc_lib.cli import format_columns
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
@ -161,7 +160,7 @@ class CreateConsistencyGroup(command.ShowOne):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(consistency_group._info)))
|
return zip(*sorted(consistency_group._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteConsistencyGroup(command.Command):
|
class DeleteConsistencyGroup(command.Command):
|
||||||
@ -335,4 +334,4 @@ class ShowConsistencyGroup(command.ShowOne):
|
|||||||
consistency_group = utils.find_resource(
|
consistency_group = utils.find_resource(
|
||||||
volume_client.consistencygroups,
|
volume_client.consistencygroups,
|
||||||
parsed_args.consistency_group)
|
parsed_args.consistency_group)
|
||||||
return zip(*sorted(six.iteritems(consistency_group._info)))
|
return zip(*sorted(consistency_group._info.items()))
|
||||||
|
@ -19,7 +19,6 @@ import logging
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
@ -68,7 +67,7 @@ class CreateConsistencyGroupSnapshot(command.ShowOne):
|
|||||||
description=parsed_args.description,
|
description=parsed_args.description,
|
||||||
)
|
)
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(consistency_group_snapshot._info)))
|
return zip(*sorted(consistency_group_snapshot._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteConsistencyGroupSnapshot(command.Command):
|
class DeleteConsistencyGroupSnapshot(command.Command):
|
||||||
@ -187,4 +186,4 @@ class ShowConsistencyGroupSnapshot(command.ShowOne):
|
|||||||
consistency_group_snapshot = utils.find_resource(
|
consistency_group_snapshot = utils.find_resource(
|
||||||
volume_client.cgsnapshots,
|
volume_client.cgsnapshots,
|
||||||
parsed_args.consistency_group_snapshot)
|
parsed_args.consistency_group_snapshot)
|
||||||
return zip(*sorted(six.iteritems(consistency_group_snapshot._info)))
|
return zip(*sorted(consistency_group_snapshot._info.items()))
|
||||||
|
@ -22,7 +22,6 @@ from osc_lib.cli import parseractions
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
@ -100,7 +99,7 @@ class CreateQos(command.ShowOne):
|
|||||||
{'properties':
|
{'properties':
|
||||||
format_columns.DictColumn(qos_spec._info.pop('specs'))}
|
format_columns.DictColumn(qos_spec._info.pop('specs'))}
|
||||||
)
|
)
|
||||||
return zip(*sorted(six.iteritems(qos_spec._info)))
|
return zip(*sorted(qos_spec._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteQos(command.Command):
|
class DeleteQos(command.Command):
|
||||||
@ -275,7 +274,7 @@ class ShowQos(command.ShowOne):
|
|||||||
{'properties':
|
{'properties':
|
||||||
format_columns.DictColumn(qos_spec._info.pop('specs'))})
|
format_columns.DictColumn(qos_spec._info.pop('specs'))})
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(qos_spec._info)))
|
return zip(*sorted(qos_spec._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class UnsetQos(command.Command):
|
class UnsetQos(command.Command):
|
||||||
|
@ -25,7 +25,6 @@ from osc_lib.cli import parseractions
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
from openstackclient.identity import common as identity_common
|
from openstackclient.identity import common as identity_common
|
||||||
@ -252,7 +251,7 @@ class CreateVolume(command.ShowOne):
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
volume._info.pop("links", None)
|
volume._info.pop("links", None)
|
||||||
return zip(*sorted(six.iteritems(volume._info)))
|
return zip(*sorted(volume._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteVolume(command.Command):
|
class DeleteVolume(command.Command):
|
||||||
@ -751,7 +750,7 @@ class ShowVolume(command.ShowOne):
|
|||||||
|
|
||||||
# Remove key links from being displayed
|
# Remove key links from being displayed
|
||||||
volume._info.pop("links", None)
|
volume._info.pop("links", None)
|
||||||
return zip(*sorted(six.iteritems(volume._info)))
|
return zip(*sorted(volume._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class UnsetVolume(command.Command):
|
class UnsetVolume(command.Command):
|
||||||
|
@ -23,7 +23,6 @@ from osc_lib.cli import parseractions
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
@ -120,7 +119,7 @@ class CreateVolumeBackup(command.ShowOne):
|
|||||||
snapshot_id=snapshot_id,
|
snapshot_id=snapshot_id,
|
||||||
)
|
)
|
||||||
backup._info.pop("links", None)
|
backup._info.pop("links", None)
|
||||||
return zip(*sorted(six.iteritems(backup._info)))
|
return zip(*sorted(backup._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteVolumeBackup(command.Command):
|
class DeleteVolumeBackup(command.Command):
|
||||||
@ -289,7 +288,7 @@ class RestoreVolumeBackup(command.ShowOne):
|
|||||||
parsed_args.volume)
|
parsed_args.volume)
|
||||||
backup = volume_client.restores.restore(backup.id,
|
backup = volume_client.restores.restore(backup.id,
|
||||||
destination_volume.id)
|
destination_volume.id)
|
||||||
return zip(*sorted(six.iteritems(backup._info)))
|
return zip(*sorted(backup._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class SetVolumeBackup(command.Command):
|
class SetVolumeBackup(command.Command):
|
||||||
@ -371,4 +370,4 @@ class ShowVolumeBackup(command.ShowOne):
|
|||||||
backup = utils.find_resource(volume_client.backups,
|
backup = utils.find_resource(volume_client.backups,
|
||||||
parsed_args.backup)
|
parsed_args.backup)
|
||||||
backup._info.pop("links", None)
|
backup._info.pop("links", None)
|
||||||
return zip(*sorted(six.iteritems(backup._info)))
|
return zip(*sorted(backup._info.items()))
|
||||||
|
@ -24,7 +24,6 @@ from osc_lib.cli import parseractions
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
from openstackclient.identity import common as identity_common
|
from openstackclient.identity import common as identity_common
|
||||||
@ -140,7 +139,7 @@ class CreateVolumeSnapshot(command.ShowOne):
|
|||||||
{'properties':
|
{'properties':
|
||||||
format_columns.DictColumn(snapshot._info.pop('metadata'))}
|
format_columns.DictColumn(snapshot._info.pop('metadata'))}
|
||||||
)
|
)
|
||||||
return zip(*sorted(six.iteritems(snapshot._info)))
|
return zip(*sorted(snapshot._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteVolumeSnapshot(command.Command):
|
class DeleteVolumeSnapshot(command.Command):
|
||||||
@ -426,7 +425,7 @@ class ShowVolumeSnapshot(command.ShowOne):
|
|||||||
{'properties':
|
{'properties':
|
||||||
format_columns.DictColumn(snapshot._info.pop('metadata'))}
|
format_columns.DictColumn(snapshot._info.pop('metadata'))}
|
||||||
)
|
)
|
||||||
return zip(*sorted(six.iteritems(snapshot._info)))
|
return zip(*sorted(snapshot._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class UnsetVolumeSnapshot(command.Command):
|
class UnsetVolumeSnapshot(command.Command):
|
||||||
|
@ -19,7 +19,6 @@ import logging
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
@ -64,7 +63,7 @@ class AcceptTransferRequest(command.ShowOne):
|
|||||||
)
|
)
|
||||||
transfer_accept._info.pop("links", None)
|
transfer_accept._info.pop("links", None)
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(transfer_accept._info)))
|
return zip(*sorted(transfer_accept._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class CreateTransferRequest(command.ShowOne):
|
class CreateTransferRequest(command.ShowOne):
|
||||||
@ -96,7 +95,7 @@ class CreateTransferRequest(command.ShowOne):
|
|||||||
)
|
)
|
||||||
volume_transfer_request._info.pop("links", None)
|
volume_transfer_request._info.pop("links", None)
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(volume_transfer_request._info)))
|
return zip(*sorted(volume_transfer_request._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteTransferRequest(command.Command):
|
class DeleteTransferRequest(command.Command):
|
||||||
@ -186,4 +185,4 @@ class ShowTransferRequest(command.ShowOne):
|
|||||||
)
|
)
|
||||||
volume_transfer_request._info.pop("links", None)
|
volume_transfer_request._info.pop("links", None)
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(volume_transfer_request._info)))
|
return zip(*sorted(volume_transfer_request._info.items()))
|
||||||
|
@ -23,7 +23,6 @@ from osc_lib.cli import parseractions
|
|||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
from openstackclient.identity import common as identity_common
|
from openstackclient.identity import common as identity_common
|
||||||
@ -235,7 +234,7 @@ class CreateVolumeType(command.ShowOne):
|
|||||||
{'encryption': format_columns.DictColumn(encryption._info)})
|
{'encryption': format_columns.DictColumn(encryption._info)})
|
||||||
volume_type._info.pop("os-volume-type-access:is_public", None)
|
volume_type._info.pop("os-volume-type-access:is_public", None)
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(volume_type._info)))
|
return zip(*sorted(volume_type._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class DeleteVolumeType(command.Command):
|
class DeleteVolumeType(command.Command):
|
||||||
@ -553,7 +552,7 @@ class ShowVolumeType(command.ShowOne):
|
|||||||
LOG.error(_("Failed to display the encryption information "
|
LOG.error(_("Failed to display the encryption information "
|
||||||
"of this volume type: %s"), e)
|
"of this volume type: %s"), e)
|
||||||
volume_type._info.pop("os-volume-type-access:is_public", None)
|
volume_type._info.pop("os-volume-type-access:is_public", None)
|
||||||
return zip(*sorted(six.iteritems(volume_type._info)))
|
return zip(*sorted(volume_type._info.items()))
|
||||||
|
|
||||||
|
|
||||||
class UnsetVolumeType(command.Command):
|
class UnsetVolumeType(command.Command):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user