diff --git a/openstackclient/common/commandmanager.py b/openstackclient/common/commandmanager.py index b809d63aea..c190e33e0d 100644 --- a/openstackclient/common/commandmanager.py +++ b/openstackclient/common/commandmanager.py @@ -56,4 +56,4 @@ class CommandManager(cliff.commandmanager.CommandManager): ) group_list.append(cmd_name) return group_list - return self.commands.keys() + return list(self.commands.keys()) diff --git a/openstackclient/common/exceptions.py b/openstackclient/common/exceptions.py index 5f5f5ab1a6..ee0f7a1104 100644 --- a/openstackclient/common/exceptions.py +++ b/openstackclient/common/exceptions.py @@ -122,7 +122,7 @@ def from_response(response, body): cls = _code_map.get(response.status, ClientException) if body: if hasattr(body, 'keys'): - error = body[body.keys()[0]] + error = body[list(body.keys())[0]] message = error.get('message') details = error.get('details') else: diff --git a/openstackclient/common/utils.py b/openstackclient/common/utils.py index 840da40218..c6ed6a716e 100644 --- a/openstackclient/common/utils.py +++ b/openstackclient/common/utils.py @@ -281,7 +281,7 @@ def get_client_class(api_name, version, version_map): client_path = version_map[str(version)] except (KeyError, ValueError): msg = "Invalid %s client version '%s'. must be one of: %s" % ( - (api_name, version, ', '.join(version_map.keys()))) + (api_name, version, ', '.join(list(version_map.keys())))) raise exceptions.UnsupportedVersion(msg) return importutils.import_class(client_path) diff --git a/openstackclient/network/v2/floating_ip.py b/openstackclient/network/v2/floating_ip.py index e0a65a481f..16f2b57472 100644 --- a/openstackclient/network/v2/floating_ip.py +++ b/openstackclient/network/v2/floating_ip.py @@ -18,7 +18,7 @@ from openstackclient.network import common def _get_columns(item): - columns = item.keys() + columns = list(item.keys()) if 'tenant_id' in columns: columns.remove('tenant_id') columns.append('project_id') diff --git a/openstackclient/network/v2/network.py b/openstackclient/network/v2/network.py index 612a17750d..074b27543d 100644 --- a/openstackclient/network/v2/network.py +++ b/openstackclient/network/v2/network.py @@ -38,7 +38,7 @@ _formatters = { def _get_columns(item): - columns = item.keys() + columns = list(item.keys()) if 'tenant_id' in columns: columns.remove('tenant_id') columns.append('project_id') diff --git a/openstackclient/network/v2/port.py b/openstackclient/network/v2/port.py index b618a4b0c7..241699ae4d 100644 --- a/openstackclient/network/v2/port.py +++ b/openstackclient/network/v2/port.py @@ -36,7 +36,7 @@ _formatters = { def _get_columns(item): - columns = item.keys() + columns = list(item.keys()) if 'tenant_id' in columns: columns.remove('tenant_id') columns.append('project_id') diff --git a/openstackclient/network/v2/router.py b/openstackclient/network/v2/router.py index 96aa55b2f1..394311112e 100644 --- a/openstackclient/network/v2/router.py +++ b/openstackclient/network/v2/router.py @@ -42,7 +42,7 @@ _formatters = { def _get_columns(item): - columns = item.keys() + columns = list(item.keys()) if 'tenant_id' in columns: columns.remove('tenant_id') columns.append('project_id') diff --git a/openstackclient/network/v2/security_group_rule.py b/openstackclient/network/v2/security_group_rule.py index 92f28cce77..9309b326a1 100644 --- a/openstackclient/network/v2/security_group_rule.py +++ b/openstackclient/network/v2/security_group_rule.py @@ -27,7 +27,7 @@ def _format_security_group_rule_show(obj): def _get_columns(item): - columns = item.keys() + columns = list(item.keys()) if 'tenant_id' in columns: columns.remove('tenant_id') columns.append('project_id') diff --git a/openstackclient/network/v2/subnet.py b/openstackclient/network/v2/subnet.py index b514a88f7d..9e53ee84d2 100644 --- a/openstackclient/network/v2/subnet.py +++ b/openstackclient/network/v2/subnet.py @@ -31,7 +31,7 @@ _formatters = { def _get_columns(item): - columns = item.keys() + columns = list(item.keys()) if 'tenant_id' in columns: columns.remove('tenant_id') columns.append('project_id') diff --git a/openstackclient/network/v2/subnet_pool.py b/openstackclient/network/v2/subnet_pool.py index 44f30207a1..d0d8d058c8 100644 --- a/openstackclient/network/v2/subnet_pool.py +++ b/openstackclient/network/v2/subnet_pool.py @@ -20,7 +20,7 @@ from openstackclient.common import utils def _get_columns(item): - columns = item.keys() + columns = list(item.keys()) if 'tenant_id' in columns: columns.remove('tenant_id') columns.append('project_id') diff --git a/openstackclient/shell.py b/openstackclient/shell.py index 53e9be08bb..7750f2a391 100644 --- a/openstackclient/shell.py +++ b/openstackclient/shell.py @@ -355,7 +355,7 @@ class OpenStackShell(app.App): self.log.warning( "%s version %s is not in supported versions %s" % (api, version_opt, - ', '.join(mod.API_VERSIONS.keys()))) + ', '.join(list(mod.API_VERSIONS.keys())))) # Command groups deal only with major versions version = '.v' + version_opt.replace('.', '_').split('_')[0]