summaryrefslogtreecommitdiff
path: root/heatclient/osc
diff options
context:
space:
mode:
authorTakashi Kajinami <tkajinam@redhat.com>2022-05-09 14:48:19 +0900
committerTakashi Kajinami <tkajinam@redhat.com>2022-05-09 17:01:25 +0000
commit23e647539cb9c6872d9f72de99c21e113fded77c (patch)
treecb1d066f225e328b664a6fa3dd73607fec181f9e /heatclient/osc
parenta12456c17c5f43a35a54e605e89f74205be1e98e (diff)
downloadpython-heatclient-23e647539cb9c6872d9f72de99c21e113fded77c.tar.gz
Remove six
This library no longer supports Python 2, thus usage of six can be removed. Change-Id: I8d0c1cfd6dff375b3b7756a5b36c95a2df3f04c6
Diffstat (limited to 'heatclient/osc')
-rw-r--r--heatclient/osc/v1/build_info.py3
-rw-r--r--heatclient/osc/v1/resource.py7
-rw-r--r--heatclient/osc/v1/resource_type.py5
-rw-r--r--heatclient/osc/v1/snapshot.py5
-rw-r--r--heatclient/osc/v1/software_config.py7
-rw-r--r--heatclient/osc/v1/stack.py13
-rw-r--r--heatclient/osc/v1/template.py5
7 files changed, 19 insertions, 26 deletions
diff --git a/heatclient/osc/v1/build_info.py b/heatclient/osc/v1/build_info.py
index 9f90dd5..cd4700a 100644
--- a/heatclient/osc/v1/build_info.py
+++ b/heatclient/osc/v1/build_info.py
@@ -17,7 +17,6 @@ import logging
from osc_lib.command import command
from osc_lib import utils
-import six
from heatclient.common import utils as heat_utils
@@ -41,6 +40,6 @@ class BuildInfo(command.ShowOne):
'api': heat_utils.json_formatter,
'engine': heat_utils.json_formatter,
}
- columns = sorted(list(six.iterkeys(result)))
+ columns = sorted(list(result.keys()))
return columns, utils.get_dict_properties(result, columns,
formatters=formatters)
diff --git a/heatclient/osc/v1/resource.py b/heatclient/osc/v1/resource.py
index e29b077..a30bae2 100644
--- a/heatclient/osc/v1/resource.py
+++ b/heatclient/osc/v1/resource.py
@@ -20,8 +20,7 @@ from osc_lib import exceptions as exc
from osc_lib.i18n import _
from osc_lib import utils
from oslo_serialization import jsonutils
-import six
-from six.moves.urllib import request
+from urllib import request
from heatclient.common import format_utils
from heatclient.common import utils as heat_utils
@@ -184,8 +183,8 @@ def _resource_metadata(heat_client, args):
{'stack': args.stack,
'resource': args.resource})
- data = list(six.itervalues(metadata))
- columns = list(six.iterkeys(metadata))
+ data = list(metadata.values())
+ columns = list(metadata.keys())
return columns, data
diff --git a/heatclient/osc/v1/resource_type.py b/heatclient/osc/v1/resource_type.py
index 6d55ab5..128b6dc 100644
--- a/heatclient/osc/v1/resource_type.py
+++ b/heatclient/osc/v1/resource_type.py
@@ -18,7 +18,6 @@ import logging
from osc_lib.command import command
from osc_lib import exceptions as exc
from osc_lib.i18n import _
-import six
from heatclient.common import format_utils
from heatclient.common import utils as heat_utils
@@ -80,8 +79,8 @@ def _show_resourcetype(heat_client, parsed_args):
raise exc.CommandError(
_('Resource type not found: %s') % parsed_args.resource_type)
- rows = list(six.itervalues(data))
- columns = list(six.iterkeys(data))
+ rows = list(data.values())
+ columns = list(data.keys())
return columns, rows
diff --git a/heatclient/osc/v1/snapshot.py b/heatclient/osc/v1/snapshot.py
index b07add9..8088285 100644
--- a/heatclient/osc/v1/snapshot.py
+++ b/heatclient/osc/v1/snapshot.py
@@ -20,7 +20,6 @@ from osc_lib.command import command
from osc_lib import exceptions as exc
from osc_lib.i18n import _
from osc_lib import utils
-import six
from heatclient.common import format_utils
from heatclient import exc as heat_exc
@@ -95,8 +94,8 @@ class ShowSnapshot(format_utils.YamlFormat):
% {'snapshot_id': snapshot_id,
'stack_id': stack_id})
- rows = list(six.itervalues(data))
- columns = list(six.iterkeys(data))
+ rows = list(data.values())
+ columns = list(data.keys())
return columns, rows
diff --git a/heatclient/osc/v1/software_config.py b/heatclient/osc/v1/software_config.py
index af27be7..41eccd2 100644
--- a/heatclient/osc/v1/software_config.py
+++ b/heatclient/osc/v1/software_config.py
@@ -18,8 +18,7 @@ import logging
from osc_lib.command import command
from osc_lib import exceptions as exc
from osc_lib import utils
-import six
-from six.moves.urllib import request
+from urllib import request
import yaml
from heatclient._i18n import _
@@ -181,8 +180,8 @@ def _create_config(heat_client, args):
config['name'] = args.name
sc = heat_client.software_configs.create(**config).to_dict()
- rows = list(six.itervalues(sc))
- columns = list(six.iterkeys(sc))
+ rows = list(sc.values())
+ columns = list(sc.keys())
return columns, rows
diff --git a/heatclient/osc/v1/stack.py b/heatclient/osc/v1/stack.py
index a25844b..583e18b 100644
--- a/heatclient/osc/v1/stack.py
+++ b/heatclient/osc/v1/stack.py
@@ -20,8 +20,7 @@ from osc_lib.command import command
from osc_lib import exceptions as exc
from osc_lib import utils
from oslo_serialization import jsonutils
-import six
-from six.moves.urllib import request
+from urllib import request
import yaml
from heatclient._i18n import _
@@ -733,7 +732,7 @@ class DeleteStack(command.Command):
try:
if not parsed_args.yes and sys.stdin.isatty():
- prompt_response = six.moves.input(
+ prompt_response = input(
_("Are you sure you want to delete this stack(s) [y/N]? ")
).lower()
if not prompt_response.startswith('y'):
@@ -919,8 +918,8 @@ class AbandonStack(format_utils.JsonFormat):
except IOError as e:
raise exc.CommandError(str(e))
- data = list(six.itervalues(stack))
- columns = list(six.iterkeys(stack))
+ data = list(stack.values())
+ columns = list(stack.keys())
return columns, data
@@ -963,8 +962,8 @@ class ExportStack(format_utils.JsonFormat):
except IOError as e:
raise exc.CommandError(str(e))
- data = list(six.itervalues(data_info))
- columns = list(six.iterkeys(data_info))
+ data = list(data_info.values())
+ columns = list(data_info.keys())
return columns, data
diff --git a/heatclient/osc/v1/template.py b/heatclient/osc/v1/template.py
index f25263e..ef29790 100644
--- a/heatclient/osc/v1/template.py
+++ b/heatclient/osc/v1/template.py
@@ -16,7 +16,6 @@ import logging
from osc_lib.command import command
from osc_lib import utils
-import six
from heatclient._i18n import _
from heatclient.common import format_utils
@@ -181,6 +180,6 @@ def _validate(heat_client, args):
fields['files_container'] = args.files_container
validation = heat_client.stacks.validate(**fields)
- data = list(six.itervalues(validation))
- columns = list(six.iterkeys(validation))
+ data = list(validation.values())
+ columns = list(validation.keys())
return columns, data