Remove Python 2 support
Python 2 has been deprecated. This patch removes all traces of six, unicode strings and Python 2 tweaks. Change-Id: I9d6fa7b57824cc8480dc7f3728d3abfae2b032da
This commit is contained in:
parent
d93365f151
commit
500babec2a
|
@ -36,7 +36,7 @@ source_suffix = '.rst'
|
||||||
master_doc = 'index'
|
master_doc = 'index'
|
||||||
|
|
||||||
# General information about the project.
|
# General information about the project.
|
||||||
copyright = u'2015, Sahara team'
|
copyright = '2015, Sahara team'
|
||||||
|
|
||||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||||
# for a list of supported languages.
|
# for a list of supported languages.
|
||||||
|
@ -154,8 +154,8 @@ htmlhelp_basename = 'saharavanillaplugin-testsdoc'
|
||||||
# Grouping the document tree into LaTeX files. List of tuples
|
# Grouping the document tree into LaTeX files. List of tuples
|
||||||
# (source start file, target name, title, author, documentclass [howto/manual]).
|
# (source start file, target name, title, author, documentclass [howto/manual]).
|
||||||
latex_documents = [
|
latex_documents = [
|
||||||
('index', 'doc-sahara-plugin-vanilla.tex', u'Sahara Vanilla Plugin Documentation',
|
('index', 'doc-sahara-plugin-vanilla.tex', 'Sahara Vanilla Plugin Documentation',
|
||||||
u'Sahara team', 'manual'),
|
'Sahara team', 'manual'),
|
||||||
]
|
]
|
||||||
|
|
||||||
# The name of an image file (relative to this directory) to place at the top of
|
# The name of an image file (relative to this directory) to place at the top of
|
||||||
|
@ -185,8 +185,8 @@ smartquotes_excludes = {'builders': ['latex']}
|
||||||
# One entry per manual page. List of tuples
|
# One entry per manual page. List of tuples
|
||||||
# (source start file, name, description, authors, manual section).
|
# (source start file, name, description, authors, manual section).
|
||||||
man_pages = [
|
man_pages = [
|
||||||
('index', 'sahara-plugin-vanilla', u'sahara-plugin-vanilla Documentation',
|
('index', 'sahara-plugin-vanilla', 'sahara-plugin-vanilla Documentation',
|
||||||
[u'Sahara team'], 1)
|
['Sahara team'], 1)
|
||||||
]
|
]
|
||||||
|
|
||||||
# If true, show URL addresses after external links.
|
# If true, show URL addresses after external links.
|
||||||
|
@ -199,8 +199,8 @@ man_pages = [
|
||||||
# (source start file, target name, title, author,
|
# (source start file, target name, title, author,
|
||||||
# dir menu entry, description, category)
|
# dir menu entry, description, category)
|
||||||
texinfo_documents = [
|
texinfo_documents = [
|
||||||
('index', 'sahara-plugin-vanilla', u'sahara-plugin-vanilla Documentation',
|
('index', 'sahara-plugin-vanilla', 'sahara-plugin-vanilla Documentation',
|
||||||
u'Sahara team', 'sahara-plugin-vanilla', 'One line description of project.',
|
'Sahara team', 'sahara-plugin-vanilla', 'One line description of project.',
|
||||||
'Miscellaneous'),
|
'Miscellaneous'),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ source_suffix = '.rst'
|
||||||
master_doc = 'index'
|
master_doc = 'index'
|
||||||
|
|
||||||
# General information about the project.
|
# General information about the project.
|
||||||
copyright = u'2015, Sahara Developers'
|
copyright = '2015, Sahara Developers'
|
||||||
|
|
||||||
# Release do not need a version number in the title, they
|
# Release do not need a version number in the title, they
|
||||||
# cover multiple versions.
|
# cover multiple versions.
|
||||||
|
@ -142,8 +142,8 @@ htmlhelp_basename = 'SaharaVanillaReleaseNotesdoc'
|
||||||
# author, documentclass [howto, manual, or own class]).
|
# author, documentclass [howto, manual, or own class]).
|
||||||
latex_documents = [
|
latex_documents = [
|
||||||
('index', 'SaharaVanillaReleaseNotes.tex',
|
('index', 'SaharaVanillaReleaseNotes.tex',
|
||||||
u'Sahara Vanilla Plugin Release Notes Documentation',
|
'Sahara Vanilla Plugin Release Notes Documentation',
|
||||||
u'Sahara Developers', 'manual'),
|
'Sahara Developers', 'manual'),
|
||||||
]
|
]
|
||||||
|
|
||||||
# The name of an image file (relative to this directory) to place at the top of
|
# The name of an image file (relative to this directory) to place at the top of
|
||||||
|
@ -173,8 +173,8 @@ latex_documents = [
|
||||||
# (source start file, name, description, authors, manual section).
|
# (source start file, name, description, authors, manual section).
|
||||||
man_pages = [
|
man_pages = [
|
||||||
('index', 'saharavanillareleasenotes',
|
('index', 'saharavanillareleasenotes',
|
||||||
u'Sahara Vanilla Plugin Release Notes Documentation',
|
'Sahara Vanilla Plugin Release Notes Documentation',
|
||||||
[u'Sahara Developers'], 1)
|
['Sahara Developers'], 1)
|
||||||
]
|
]
|
||||||
|
|
||||||
# If true, show URL addresses after external links.
|
# If true, show URL addresses after external links.
|
||||||
|
@ -188,8 +188,8 @@ man_pages = [
|
||||||
# dir menu entry, description, category)
|
# dir menu entry, description, category)
|
||||||
texinfo_documents = [
|
texinfo_documents = [
|
||||||
('index', 'SaharaVanillaReleaseNotes',
|
('index', 'SaharaVanillaReleaseNotes',
|
||||||
u'Sahara Vanilla Plugin Release Notes Documentation',
|
'Sahara Vanilla Plugin Release Notes Documentation',
|
||||||
u'Sahara Developers', 'SaharaVanillaReleaseNotes',
|
'Sahara Developers', 'SaharaVanillaReleaseNotes',
|
||||||
'One line description of project.',
|
'One line description of project.',
|
||||||
'Miscellaneous'),
|
'Miscellaneous'),
|
||||||
]
|
]
|
||||||
|
|
|
@ -15,11 +15,8 @@
|
||||||
|
|
||||||
import abc
|
import abc
|
||||||
|
|
||||||
import six
|
|
||||||
|
|
||||||
|
class AbstractVersionHandler(object, metaclass=abc.ABCMeta):
|
||||||
@six.add_metaclass(abc.ABCMeta)
|
|
||||||
class AbstractVersionHandler(object):
|
|
||||||
|
|
||||||
@abc.abstractmethod
|
@abc.abstractmethod
|
||||||
def get_node_processes(self):
|
def get_node_processes(self):
|
||||||
|
|
|
@ -16,7 +16,6 @@ import os
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
import six
|
|
||||||
|
|
||||||
from sahara.plugins import castellan_utils as key_manager
|
from sahara.plugins import castellan_utils as key_manager
|
||||||
from sahara.plugins import context
|
from sahara.plugins import context
|
||||||
|
@ -315,8 +314,8 @@ def _get_user_configs(pctx, node_group):
|
||||||
def _separate_configs(configs, all_env_configs):
|
def _separate_configs(configs, all_env_configs):
|
||||||
xml_configs = {}
|
xml_configs = {}
|
||||||
env_configs = {}
|
env_configs = {}
|
||||||
for service, params in six.iteritems(configs):
|
for service, params in configs.items():
|
||||||
for param, value in six.iteritems(params):
|
for param, value in params.items():
|
||||||
if all_env_configs.get(service, {}).get(param):
|
if all_env_configs.get(service, {}).get(param):
|
||||||
if not env_configs.get(service):
|
if not env_configs.get(service):
|
||||||
env_configs[service] = {}
|
env_configs[service] = {}
|
||||||
|
@ -331,7 +330,7 @@ def _separate_configs(configs, all_env_configs):
|
||||||
|
|
||||||
def _generate_xml(configs):
|
def _generate_xml(configs):
|
||||||
xml_confs = {}
|
xml_confs = {}
|
||||||
for service, confs in six.iteritems(configs):
|
for service, confs in configs.items():
|
||||||
xml_confs[service] = utils.create_hadoop_xml(confs)
|
xml_confs[service] = utils.create_hadoop_xml(confs)
|
||||||
|
|
||||||
return xml_confs
|
return xml_confs
|
||||||
|
@ -383,7 +382,7 @@ def _push_xml_configs(instance, configs):
|
||||||
'Hive': '%s/hive-site.xml' % HIVE_CONF_DIR
|
'Hive': '%s/hive-site.xml' % HIVE_CONF_DIR
|
||||||
}
|
}
|
||||||
xml_confs = {}
|
xml_confs = {}
|
||||||
for service, confs in six.iteritems(xmls):
|
for service, confs in xmls.items():
|
||||||
if service not in service_to_conf_map.keys():
|
if service not in service_to_conf_map.keys():
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
@ -396,7 +395,7 @@ def _push_configs_to_instance(instance, configs):
|
||||||
LOG.debug("Push configs to instance {instance}".format(
|
LOG.debug("Push configs to instance {instance}".format(
|
||||||
instance=instance.instance_name))
|
instance=instance.instance_name))
|
||||||
with instance.remote() as r:
|
with instance.remote() as r:
|
||||||
for fl, data in six.iteritems(configs):
|
for fl, data in configs.items():
|
||||||
r.write_file_to(fl, data, run_as_root=True)
|
r.write_file_to(fl, data, run_as_root=True)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
import six
|
|
||||||
|
|
||||||
from sahara.plugins import exceptions as ex
|
from sahara.plugins import exceptions as ex
|
||||||
from sahara.plugins import provisioning as p
|
from sahara.plugins import provisioning as p
|
||||||
|
@ -152,7 +151,7 @@ PRIORITY_1_CONFS += CLUSTER_WIDE_CONFS
|
||||||
|
|
||||||
def init_xml_configs(xml_confs):
|
def init_xml_configs(xml_confs):
|
||||||
configs = []
|
configs = []
|
||||||
for service, config_lists in six.iteritems(xml_confs):
|
for service, config_lists in xml_confs.items():
|
||||||
for config_list in config_lists:
|
for config_list in config_lists:
|
||||||
for config in config_list:
|
for config in config_list:
|
||||||
if config['name'] not in HIDDEN_CONFS:
|
if config['name'] not in HIDDEN_CONFS:
|
||||||
|
@ -212,8 +211,8 @@ DATANODES_STARTUP_TIMEOUT = p.Config(
|
||||||
|
|
||||||
def init_env_configs(env_confs):
|
def init_env_configs(env_confs):
|
||||||
configs = []
|
configs = []
|
||||||
for service, config_items in six.iteritems(env_confs):
|
for service, config_items in env_confs.items():
|
||||||
for name, value in six.iteritems(config_items):
|
for name, value in config_items.items():
|
||||||
configs.append(p.Config(name, service, "node",
|
configs.append(p.Config(name, service, "node",
|
||||||
default_value=value, priority=1,
|
default_value=value, priority=1,
|
||||||
config_type="int"))
|
config_type="int"))
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
import copy
|
import copy
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
import six
|
|
||||||
|
|
||||||
from sahara.plugins import provisioning as p
|
from sahara.plugins import provisioning as p
|
||||||
from sahara.plugins import utils
|
from sahara.plugins import utils
|
||||||
|
@ -116,7 +115,7 @@ def _get_spark_opt_default(opt_name):
|
||||||
|
|
||||||
def _get_spark_configs():
|
def _get_spark_configs():
|
||||||
spark_configs = []
|
spark_configs = []
|
||||||
for service, config_items in six.iteritems(SPARK_CONFS):
|
for service, config_items in SPARK_CONFS.items():
|
||||||
for item in config_items['OPTIONS']:
|
for item in config_items['OPTIONS']:
|
||||||
cfg = p.Config(name=item["name"],
|
cfg = p.Config(name=item["name"],
|
||||||
description=item["description"],
|
description=item["description"],
|
||||||
|
@ -130,7 +129,7 @@ def _get_spark_configs():
|
||||||
|
|
||||||
def _get_zookeeper_configs():
|
def _get_zookeeper_configs():
|
||||||
zk_configs = []
|
zk_configs = []
|
||||||
for service, config_items in six.iteritems(config_helper.ZOOKEEPER_CONFS):
|
for service, config_items in config_helper.ZOOKEEPER_CONFS.items():
|
||||||
for item in config_items['OPTIONS']:
|
for item in config_items['OPTIONS']:
|
||||||
cfg = p.Config(name=item["name"],
|
cfg = p.Config(name=item["name"],
|
||||||
description=item["description"],
|
description=item["description"],
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
import copy
|
import copy
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
import six
|
|
||||||
|
|
||||||
from sahara.plugins import provisioning as p
|
from sahara.plugins import provisioning as p
|
||||||
from sahara.plugins import utils
|
from sahara.plugins import utils
|
||||||
|
@ -116,7 +115,7 @@ def _get_spark_opt_default(opt_name):
|
||||||
|
|
||||||
def _get_spark_configs():
|
def _get_spark_configs():
|
||||||
spark_configs = []
|
spark_configs = []
|
||||||
for service, config_items in six.iteritems(SPARK_CONFS):
|
for service, config_items in SPARK_CONFS.items():
|
||||||
for item in config_items['OPTIONS']:
|
for item in config_items['OPTIONS']:
|
||||||
cfg = p.Config(name=item["name"],
|
cfg = p.Config(name=item["name"],
|
||||||
description=item["description"],
|
description=item["description"],
|
||||||
|
@ -130,7 +129,7 @@ def _get_spark_configs():
|
||||||
|
|
||||||
def _get_zookeeper_configs():
|
def _get_zookeeper_configs():
|
||||||
zk_configs = []
|
zk_configs = []
|
||||||
for service, config_items in six.iteritems(config_helper.ZOOKEEPER_CONFS):
|
for service, config_items in config_helper.ZOOKEEPER_CONFS.items():
|
||||||
for item in config_items['OPTIONS']:
|
for item in config_items['OPTIONS']:
|
||||||
cfg = p.Config(name=item["name"],
|
cfg = p.Config(name=item["name"],
|
||||||
description=item["description"],
|
description=item["description"],
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
import copy
|
import copy
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
import six
|
|
||||||
|
|
||||||
from sahara.plugins import provisioning as p
|
from sahara.plugins import provisioning as p
|
||||||
from sahara.plugins import utils
|
from sahara.plugins import utils
|
||||||
|
@ -116,7 +115,7 @@ def _get_spark_opt_default(opt_name):
|
||||||
|
|
||||||
def _get_spark_configs():
|
def _get_spark_configs():
|
||||||
spark_configs = []
|
spark_configs = []
|
||||||
for service, config_items in six.iteritems(SPARK_CONFS):
|
for service, config_items in SPARK_CONFS.items():
|
||||||
for item in config_items['OPTIONS']:
|
for item in config_items['OPTIONS']:
|
||||||
cfg = p.Config(name=item["name"],
|
cfg = p.Config(name=item["name"],
|
||||||
description=item["description"],
|
description=item["description"],
|
||||||
|
@ -130,7 +129,7 @@ def _get_spark_configs():
|
||||||
|
|
||||||
def _get_zookeeper_configs():
|
def _get_zookeeper_configs():
|
||||||
zk_configs = []
|
zk_configs = []
|
||||||
for service, config_items in six.iteritems(config_helper.ZOOKEEPER_CONFS):
|
for service, config_items in config_helper.ZOOKEEPER_CONFS.items():
|
||||||
for item in config_items['OPTIONS']:
|
for item in config_items['OPTIONS']:
|
||||||
cfg = p.Config(name=item["name"],
|
cfg = p.Config(name=item["name"],
|
||||||
description=item["description"],
|
description=item["description"],
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
|
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
import six
|
|
||||||
import testtools
|
import testtools
|
||||||
|
|
||||||
from sahara.plugins import base as pb
|
from sahara.plugins import base as pb
|
||||||
|
@ -55,7 +54,7 @@ class VersionHandlerTest(base.SaharaTestCase):
|
||||||
|
|
||||||
def test_get_node_processes(self):
|
def test_get_node_processes(self):
|
||||||
processes = self.vh.get_node_processes()
|
processes = self.vh.get_node_processes()
|
||||||
for k, v in six.iteritems(processes):
|
for k, v in processes.items():
|
||||||
for p in v:
|
for p in v:
|
||||||
self.assertIsInstance(p, str)
|
self.assertIsInstance(p, str)
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
|
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
import six
|
|
||||||
import testtools
|
import testtools
|
||||||
|
|
||||||
from sahara.plugins import base as pb
|
from sahara.plugins import base as pb
|
||||||
|
@ -55,7 +54,7 @@ class VersionHandlerTest(base.SaharaTestCase):
|
||||||
|
|
||||||
def test_get_node_processes(self):
|
def test_get_node_processes(self):
|
||||||
processes = self.vh.get_node_processes()
|
processes = self.vh.get_node_processes()
|
||||||
for k, v in six.iteritems(processes):
|
for k, v in processes.items():
|
||||||
for p in v:
|
for p in v:
|
||||||
self.assertIsInstance(p, str)
|
self.assertIsInstance(p, str)
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
|
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
import six
|
|
||||||
import testtools
|
import testtools
|
||||||
|
|
||||||
from sahara.plugins import exceptions as ex
|
from sahara.plugins import exceptions as ex
|
||||||
|
@ -52,7 +51,7 @@ class VersionHandlerTest(base.SaharaTestCase):
|
||||||
|
|
||||||
def test_get_node_processes(self):
|
def test_get_node_processes(self):
|
||||||
processes = self.vh.get_node_processes()
|
processes = self.vh.get_node_processes()
|
||||||
for k, v in six.iteritems(processes):
|
for k, v in processes.items():
|
||||||
for p in v:
|
for p in v:
|
||||||
self.assertIsInstance(p, str)
|
self.assertIsInstance(p, str)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue