summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorHervé Beraud <hberaud@redhat.com>2019-11-20 19:37:27 +0100
committerHervé Beraud <hberaud@redhat.com>2020-04-23 14:49:12 +0200
commit8c96a4d85674e164d562f9e7907c18bc997d0efb (patch)
treed1a61bdc0e5ff7b7c475b24b643024c830cc1a33 /tools
parent062ce29a3b60f8457b09f9abd98f32ee632ddde4 (diff)
downloadheat-8c96a4d85674e164d562f9e7907c18bc997d0efb.tar.gz
Remove six and python 2.7 full support
Six is in use to help us to keep support for python 2.7. Since the ussuri cycle we decide to remove the python 2.7 support so we can go ahead and also remove six usage from the python code. Review process and help ----------------------- Removing six introduce a lot of changes and an huge amount of modified files To simplify reviews we decided to split changes into several patches to avoid painful reviews and avoid mistakes. To review this patch you can use the six documentation [1] to obtain help and understand choices. Additional informations ----------------------- Changes related to 'six.b(data)' [2] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ six.b [2] encode the given datas in latin-1 in python3 so I did the same things in this patch. Latin-1 is equal to iso-8859-1 [3]. This encoding is the default encoding [4] of certain descriptive HTTP headers. I suggest to keep latin-1 for the moment and to move to another encoding in a follow-up patch if needed to move to most powerful encoding (utf8). HTML4 support utf8 charset and utf8 is the default charset for HTML5 [5]. Note that this commit message is autogenerated and not necesserly contains changes related to 'six.b' [1] https://six.readthedocs.io/ [2] https://six.readthedocs.io/#six.b [3] https://docs.python.org/3/library/codecs.html#standard-encodings [4] https://www.w3schools.com/charsets/ref_html_8859.asp [5] https://www.w3schools.com/html/html_charset.asp Patch 28 of a serie of 28 patches six fully removed now! Thank you six for the rendered services! Change-Id: If44ee4b565cc9390fa0422fba4dda080b4f90b98
Diffstat (limited to 'tools')
-rw-r--r--tools/custom_guidelines.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/tools/custom_guidelines.py b/tools/custom_guidelines.py
index 3e8f4e2c7..53306d0cc 100644
--- a/tools/custom_guidelines.py
+++ b/tools/custom_guidelines.py
@@ -16,7 +16,6 @@ import re
import sys
from oslo_log import log
-import six
from heat.common.i18n import _
from heat.engine import constraints
@@ -101,7 +100,7 @@ class HeatCustomGuidelines(object):
def _check_resource_schemas(self, resource, schema, schema_name,
error_path=None):
- for key, value in six.iteritems(schema):
+ for key, value in schema.items():
if error_path is None:
error_path = [resource.__name__, key]
else:
@@ -129,7 +128,7 @@ class HeatCustomGuidelines(object):
error_path.pop()
def _check_resource_methods(self, resource):
- for method in six.itervalues(resource.__dict__):
+ for method in resource.__dict__.values():
# need to skip non-functions attributes
if not callable(method):
continue
@@ -159,7 +158,7 @@ class HeatCustomGuidelines(object):
cls_file = open(cls.__module__.replace('.', '/') + '.py')
except IOError as ex:
LOG.warning('Cannot perform trailing spaces check on '
- 'resource module: %s', six.text_type(ex))
+ 'resource module: %s', str(ex))
continue
lines = [line.strip() for line in cls_file.readlines()]
idx = 0