Merge "Remove Python 2 support"

This commit is contained in:
Zuul 2023-11-03 08:10:44 +00:00 committed by Gerrit Code Review
commit 48a42bcd45
6 changed files with 21 additions and 27 deletions

View File

@ -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 = 'saharasparkplugin-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-spark.tex', u'Sahara Spark Plugin Documentation', ('index', 'doc-sahara-plugin-spark.tex', 'Sahara Spark 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-spark', u'sahara-plugin-spark Documentation', ('index', 'sahara-plugin-spark', 'sahara-plugin-spark 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-spark', u'sahara-plugin-spark Documentation', ('index', 'sahara-plugin-spark', 'sahara-plugin-spark Documentation',
u'Sahara team', 'sahara-plugin-spark', 'One line description of project.', 'Sahara team', 'sahara-plugin-spark', 'One line description of project.',
'Miscellaneous'), 'Miscellaneous'),
] ]

View File

@ -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 = 'SaharaSparkReleaseNotesdoc'
# author, documentclass [howto, manual, or own class]). # author, documentclass [howto, manual, or own class]).
latex_documents = [ latex_documents = [
('index', 'SaharaSparkReleaseNotes.tex', ('index', 'SaharaSparkReleaseNotes.tex',
u'Sahara Spark Plugin Release Notes Documentation', 'Sahara Spark 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', 'saharasparkreleasenotes', ('index', 'saharasparkreleasenotes',
u'Sahara Spark Plugin Release Notes Documentation', 'Sahara Spark 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', 'SaharaSparkReleaseNotes', ('index', 'SaharaSparkReleaseNotes',
u'Sahara Spark Plugin Release Notes Documentation', 'Sahara Spark Plugin Release Notes Documentation',
u'Sahara Developers', 'SaharaSparkReleaseNotes', 'Sahara Developers', 'SaharaSparkReleaseNotes',
'One line description of project.', 'One line description of project.',
'Miscellaneous'), 'Miscellaneous'),
] ]

View File

@ -12,4 +12,3 @@ oslo.serialization!=2.19.1,>=2.18.0 # Apache-2.0
oslo.utils>=3.33.0 # Apache-2.0 oslo.utils>=3.33.0 # Apache-2.0
requests>=2.14.2 # Apache-2.0 requests>=2.14.2 # Apache-2.0
sahara>=10.0.0.0b1 sahara>=10.0.0.0b1
six>=1.10.0 # MIT

View File

@ -15,7 +15,6 @@
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 provisioning as p from sahara.plugins import provisioning as p
from sahara.plugins import swift_helper as swift from sahara.plugins import swift_helper as swift
@ -184,7 +183,7 @@ PRIORITY_1_CONFS += CLUSTER_WIDE_CONFS
def _initialise_configs(): def _initialise_configs():
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:
@ -204,13 +203,13 @@ def _initialise_configs():
cfg.priority = 1 cfg.priority = 1
configs.append(cfg) configs.append(cfg)
for service, config_items in six.iteritems(ENV_CONFS): for service, config_items in ENV_CONFS.items():
for name, param_format_str in six.iteritems(config_items): for name, param_format_str in config_items.items():
configs.append(p.Config(name, service, "node", configs.append(p.Config(name, service, "node",
default_value=1024, priority=1, default_value=1024, priority=1,
config_type="int")) config_type="int"))
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"],
@ -279,7 +278,7 @@ def generate_xml_configs(configs, storage_path, nn_hostname, hadoop_port):
if is_swift_enabled(configs): if is_swift_enabled(configs):
swft_def = SWIFT_DEFAULTS swft_def = SWIFT_DEFAULTS
swift_configs = extract_name_values(swift.get_swift_configs()) swift_configs = extract_name_values(swift.get_swift_configs())
for key, value in six.iteritems(swift_configs): for key, value in swift_configs.items():
if key not in cfg: if key not in cfg:
cfg[key] = value cfg[key] = value

View File

@ -16,8 +16,6 @@
import os import os
import six
from sahara.plugins import edp from sahara.plugins import edp
from sahara.plugins import exceptions as ex from sahara.plugins import exceptions as ex
from sahara.plugins import utils as plugin_utils from sahara.plugins import utils as plugin_utils
@ -37,7 +35,7 @@ class EdpEngine(edp.PluginsSparkJobEngine):
get_config_value_or_default("Spark", "Spark home", self.cluster), get_config_value_or_default("Spark", "Spark home", self.cluster),
"bin/spark-submit") "bin/spark-submit")
self.plugin_params["deploy-mode"] = "client" self.plugin_params["deploy-mode"] = "client"
port_str = six.text_type( port_str = str(
plugin_utils.get_config_value_or_default( plugin_utils.get_config_value_or_default(
"Spark", "Master port", self.cluster)) "Spark", "Master port", self.cluster))
self.plugin_params["master"] = ('spark://%(host)s:' + port_str) self.plugin_params["master"] = ('spark://%(host)s:' + port_str)

View File

@ -15,8 +15,6 @@
import os import os
import six
from sahara.plugins import context from sahara.plugins import context
from sahara.plugins import utils from sahara.plugins import utils
from sahara_plugin_spark.i18n import _ from sahara_plugin_spark.i18n import _
@ -94,7 +92,7 @@ def parse_dfs_report(cmd_output):
res = [] res = []
datanode_info = {} datanode_info = {}
for i in six.moves.xrange(0, len(array)): for i in range(0, len(array)):
if array[i]: if array[i]:
idx = str.find(array[i], ':') idx = str.find(array[i], ':')
name = array[i][0:idx] name = array[i][0:idx]