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