Fix bashate and flake8 errors
This change fixes few linting errors which are discovered by newer linters. - bashate: consistent 4 chars identation - python unamed Exceptions - python space around operators - python space after # comments - python unused imports - python unknown escapes (errors after py36) - python double newline before methods Change-Id: I5d2f37d1c820b1983355be60c09de581a72e08e0 Needed-By: https://review.opendev.org/#/c/665445/
This commit is contained in:
parent
11ac44b8ba
commit
26a3d7e6d0
|
@ -57,7 +57,7 @@ def _workbook_to_rst(name, workbook):
|
|||
yield ''
|
||||
|
||||
if 'description' in workflow:
|
||||
if len(workflow['description'].split("\n"))>2:
|
||||
if len(workflow['description'].split("\n")) > 2:
|
||||
for _line in workflow['description'].split("\n"):
|
||||
_new_line = ' ' + _line
|
||||
yield _new_line
|
||||
|
@ -71,7 +71,7 @@ def _workbook_to_rst(name, workbook):
|
|||
try:
|
||||
yield ' :input {}: Default: {}'.format(
|
||||
*input_param.items()[0])
|
||||
except:
|
||||
except Exception:
|
||||
yield ' :input {}: Required.'.format(input_param)
|
||||
yield ''
|
||||
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
file="${1:-root}"
|
||||
if [ -f /var/spool/cron/${file} ]; then
|
||||
nb_lines=$(grep -cEv '^#' /var/spool/cron/${file})
|
||||
if [ $nb_lines -ge 2 ]; then
|
||||
exit 0
|
||||
fi
|
||||
nb_lines=$(grep -cEv '^#' /var/spool/cron/${file})
|
||||
if [ $nb_lines -ge 2 ]; then
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
exit 1
|
||||
|
|
|
@ -13,7 +13,7 @@ fi
|
|||
|
||||
# Make Healthcheck URL IPv6 compatible
|
||||
if [[ $bind_host =~ .*:.* ]]; then
|
||||
bind_host="[${bind_host}]"
|
||||
bind_host="[${bind_host}]"
|
||||
fi
|
||||
|
||||
healthcheck_curl http://$bind_host:$bind_port/diagstatus
|
||||
|
|
|
@ -6,10 +6,10 @@ process=zaqar-server
|
|||
args="${@:-9000}"
|
||||
|
||||
if healthcheck_listen $process $args; then
|
||||
exit 0
|
||||
exit 0
|
||||
else
|
||||
ports=${args// /,}
|
||||
echo "There is no $process process, listening on port(s) $ports, running in the container."
|
||||
exit 1
|
||||
ports=${args// /,}
|
||||
echo "There is no $process process, listening on port(s) $ports, running in the container."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
|
|
@ -16,12 +16,12 @@
|
|||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
#sys.path.insert(0, os.path.abspath('.'))
|
||||
# sys.path.insert(0, os.path.abspath('.'))
|
||||
|
||||
# -- General configuration ------------------------------------------------
|
||||
|
||||
# If your documentation needs a minimal Sphinx version, state it here.
|
||||
#needs_sphinx = '1.0'
|
||||
# needs_sphinx = '1.0'
|
||||
|
||||
# Add any Sphinx extension module names here, as strings. They can be
|
||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||
|
@ -38,7 +38,7 @@ templates_path = ['_templates']
|
|||
source_suffix = '.rst'
|
||||
|
||||
# The encoding of source files.
|
||||
#source_encoding = 'utf-8-sig'
|
||||
# source_encoding = 'utf-8-sig'
|
||||
|
||||
# The master toctree document.
|
||||
master_doc = 'index'
|
||||
|
@ -60,13 +60,13 @@ version = ''
|
|||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
#language = None
|
||||
# language = None
|
||||
|
||||
# There are two options for replacing |today|: either, you set today to some
|
||||
# non-false value, then it is used:
|
||||
#today = ''
|
||||
# today = ''
|
||||
# Else, today_fmt is used as the format for a strftime call.
|
||||
#today_fmt = '%B %d, %Y'
|
||||
# today_fmt = '%B %d, %Y'
|
||||
|
||||
# List of patterns, relative to source directory, that match files and
|
||||
# directories to ignore when looking for source files.
|
||||
|
@ -74,27 +74,27 @@ exclude_patterns = []
|
|||
|
||||
# The reST default role (used for this markup: `text`) to use for all
|
||||
# documents.
|
||||
#default_role = None
|
||||
# default_role = None
|
||||
|
||||
# If true, '()' will be appended to :func: etc. cross-reference text.
|
||||
#add_function_parentheses = True
|
||||
# add_function_parentheses = True
|
||||
|
||||
# If true, the current module name will be prepended to all description
|
||||
# unit titles (such as .. function::).
|
||||
#add_module_names = True
|
||||
# add_module_names = True
|
||||
|
||||
# If true, sectionauthor and moduleauthor directives will be shown in the
|
||||
# output. They are ignored by default.
|
||||
#show_authors = False
|
||||
# show_authors = False
|
||||
|
||||
# The name of the Pygments (syntax highlighting) style to use.
|
||||
pygments_style = 'sphinx'
|
||||
|
||||
# A list of ignored prefixes for module index sorting.
|
||||
#modindex_common_prefix = []
|
||||
# modindex_common_prefix = []
|
||||
|
||||
# If true, keep warnings as "system message" paragraphs in the built documents.
|
||||
#keep_warnings = False
|
||||
# keep_warnings = False
|
||||
|
||||
|
||||
# -- Options for HTML output ----------------------------------------------
|
||||
|
@ -106,26 +106,26 @@ html_theme = 'openstackdocs'
|
|||
# Theme options are theme-specific and customize the look and feel of a theme
|
||||
# further. For a list of options available for each theme, see the
|
||||
# documentation.
|
||||
#html_theme_options = {}
|
||||
# html_theme_options = {}
|
||||
|
||||
# Add any paths that contain custom themes here, relative to this directory.
|
||||
#html_theme_path = []
|
||||
# html_theme_path = []
|
||||
|
||||
# The name for this set of Sphinx documents. If None, it defaults to
|
||||
# "<project> v<release> documentation".
|
||||
#html_title = None
|
||||
# html_title = None
|
||||
|
||||
# A shorter title for the navigation bar. Default is the same as html_title.
|
||||
#html_short_title = None
|
||||
# html_short_title = None
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top
|
||||
# of the sidebar.
|
||||
#html_logo = None
|
||||
# html_logo = None
|
||||
|
||||
# The name of an image file (within the static path) to use as favicon of the
|
||||
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
||||
# pixels large.
|
||||
#html_favicon = None
|
||||
# html_favicon = None
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
|
@ -135,48 +135,48 @@ html_static_path = ['_static']
|
|||
# Add any extra paths that contain custom files (such as robots.txt or
|
||||
# .htaccess) here, relative to this directory. These files are copied
|
||||
# directly to the root of the documentation.
|
||||
#html_extra_path = []
|
||||
# html_extra_path = []
|
||||
|
||||
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
|
||||
# using the given strftime format.
|
||||
#html_last_updated_fmt = '%b %d, %Y'
|
||||
# html_last_updated_fmt = '%b %d, %Y'
|
||||
|
||||
# If true, SmartyPants will be used to convert quotes and dashes to
|
||||
# typographically correct entities.
|
||||
#html_use_smartypants = True
|
||||
# html_use_smartypants = True
|
||||
|
||||
# Custom sidebar templates, maps document names to template names.
|
||||
#html_sidebars = {}
|
||||
# html_sidebars = {}
|
||||
|
||||
# Additional templates that should be rendered to pages, maps page names to
|
||||
# template names.
|
||||
#html_additional_pages = {}
|
||||
# html_additional_pages = {}
|
||||
|
||||
# If false, no module index is generated.
|
||||
#html_domain_indices = True
|
||||
# html_domain_indices = True
|
||||
|
||||
# If false, no index is generated.
|
||||
#html_use_index = True
|
||||
# html_use_index = True
|
||||
|
||||
# If true, the index is split into individual pages for each letter.
|
||||
#html_split_index = False
|
||||
# html_split_index = False
|
||||
|
||||
# If true, links to the reST sources are added to the pages.
|
||||
#html_show_sourcelink = True
|
||||
# html_show_sourcelink = True
|
||||
|
||||
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
|
||||
#html_show_sphinx = True
|
||||
# html_show_sphinx = True
|
||||
|
||||
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
|
||||
#html_show_copyright = True
|
||||
# html_show_copyright = True
|
||||
|
||||
# If true, an OpenSearch description file will be output, and all pages will
|
||||
# contain a <link> tag referring to it. The value of this option must be the
|
||||
# base URL from which the finished HTML is served.
|
||||
#html_use_opensearch = ''
|
||||
# html_use_opensearch = ''
|
||||
|
||||
# This is the file name suffix for HTML files (e.g. ".xhtml").
|
||||
#html_file_suffix = None
|
||||
# html_file_suffix = None
|
||||
|
||||
# Output file base name for HTML help builder.
|
||||
htmlhelp_basename = 'tripleo-commonReleaseNotesdoc'
|
||||
|
@ -185,43 +185,44 @@ htmlhelp_basename = 'tripleo-commonReleaseNotesdoc'
|
|||
# -- Options for LaTeX output ---------------------------------------------
|
||||
|
||||
latex_elements = {
|
||||
# The paper size ('letterpaper' or 'a4paper').
|
||||
#'papersize': 'letterpaper',
|
||||
# The paper size ('letterpaper' or 'a4paper').
|
||||
# 'papersize': 'letterpaper',
|
||||
|
||||
# The font size ('10pt', '11pt' or '12pt').
|
||||
#'pointsize': '10pt',
|
||||
# The font size ('10pt', '11pt' or '12pt').
|
||||
# 'pointsize': '10pt',
|
||||
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
#'preamble': '',
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
# 'preamble': '',
|
||||
}
|
||||
|
||||
# Grouping the document tree into LaTeX files. List of tuples
|
||||
# (source start file, target name, title,
|
||||
# author, documentclass [howto, manual, or own class]).
|
||||
latex_documents = [
|
||||
('index', 'tripleo-commonReleaseNotes.tex', u'tripleo-common Release Notes Documentation',
|
||||
u'2016, TripleO Developers', 'manual'),
|
||||
('index', 'tripleo-commonReleaseNotes.tex',
|
||||
u'tripleo-common Release Notes Documentation',
|
||||
u'2016, TripleO Developers', 'manual'),
|
||||
]
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top of
|
||||
# the title page.
|
||||
#latex_logo = None
|
||||
# latex_logo = None
|
||||
|
||||
# For "manual" documents, if this is true, then toplevel headings are parts,
|
||||
# not chapters.
|
||||
#latex_use_parts = False
|
||||
# latex_use_parts = False
|
||||
|
||||
# If true, show page references after internal links.
|
||||
#latex_show_pagerefs = False
|
||||
# latex_show_pagerefs = False
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
#latex_show_urls = False
|
||||
# latex_show_urls = False
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
#latex_appendices = []
|
||||
# latex_appendices = []
|
||||
|
||||
# If false, no module index is generated.
|
||||
#latex_domain_indices = True
|
||||
# latex_domain_indices = True
|
||||
|
||||
|
||||
# -- Options for manual page output ---------------------------------------
|
||||
|
@ -229,12 +230,13 @@ latex_documents = [
|
|||
# One entry per manual page. List of tuples
|
||||
# (source start file, name, description, authors, manual section).
|
||||
man_pages = [
|
||||
('index', 'tripleo-commonreleasenotes', u'tripleo-common Release Notes Documentation',
|
||||
('index', 'tripleo-commonreleasenotes',
|
||||
u'tripleo-common Release Notes Documentation',
|
||||
[u'2016, TripleO Developers'], 1)
|
||||
]
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
#man_show_urls = False
|
||||
# man_show_urls = False
|
||||
|
||||
|
||||
# -- Options for Texinfo output -------------------------------------------
|
||||
|
@ -243,22 +245,25 @@ man_pages = [
|
|||
# (source start file, target name, title, author,
|
||||
# dir menu entry, description, category)
|
||||
texinfo_documents = [
|
||||
('index', 'tripleo-commonReleaseNotes', u'tripleo-common Release Notes Documentation',
|
||||
u'2016, TripleO Developers', 'tripleo-commonReleaseNotes', 'One line description of project.',
|
||||
'Miscellaneous'),
|
||||
('index', 'tripleo-commonReleaseNotes',
|
||||
u'tripleo-common Release Notes Documentation',
|
||||
u'2016, TripleO Developers',
|
||||
'tripleo-commonReleaseNotes',
|
||||
'One line description of project.',
|
||||
'Miscellaneous'),
|
||||
]
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
#texinfo_appendices = []
|
||||
# texinfo_appendices = []
|
||||
|
||||
# If false, no module index is generated.
|
||||
#texinfo_domain_indices = True
|
||||
# texinfo_domain_indices = True
|
||||
|
||||
# How to display URL addresses: 'footnote', 'no', or 'inline'.
|
||||
#texinfo_show_urls = 'footnote'
|
||||
# texinfo_show_urls = 'footnote'
|
||||
|
||||
# If true, do not generate a @detailmenu in the "Top" node's menu.
|
||||
#texinfo_no_detailmenu = False
|
||||
# texinfo_no_detailmenu = False
|
||||
|
||||
# -- Options for Internationalization output ------------------------------
|
||||
locale_dirs = ['locale/']
|
||||
|
|
|
@ -14,11 +14,8 @@
|
|||
# under the License.
|
||||
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
import yaml
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_config import types
|
||||
|
@ -39,17 +36,14 @@ _opts = [
|
|||
item_type=types.String(),
|
||||
default=['disk_images.yaml'],
|
||||
help=("""Path to configuration file. Can be specified """
|
||||
"""multiple times"""),
|
||||
),
|
||||
"""multiple times""")),
|
||||
cfg.StrOpt('output-directory',
|
||||
default=env.get('TRIPLEO_ROOT', '.'),
|
||||
help=("""output directory for images. """
|
||||
"""Defaults to $TRIPLEO_ROOT, or current directory""")
|
||||
),
|
||||
"""Defaults to $TRIPLEO_ROOT, or current directory""")),
|
||||
cfg.BoolOpt('skip',
|
||||
default=False,
|
||||
help="""Skip build if cached image exists."""
|
||||
),
|
||||
help="""Skip build if cached image exists."""),
|
||||
cfg.BoolOpt('json-output',
|
||||
default=False,
|
||||
help="""Skip build and only output the configuration in a """
|
||||
|
@ -65,6 +59,7 @@ CONF.register_cli_opts(_opts, group=image_opt_group)
|
|||
CONF.set_default('use_stderr', True)
|
||||
log.setup(CONF, 'build-overcloud-images')
|
||||
|
||||
|
||||
def main(argv=sys.argv):
|
||||
CONF(argv[1:])
|
||||
LOG.info('Using config files at: %s' % CONF.image.config_file)
|
||||
|
@ -78,5 +73,6 @@ def main(argv=sys.argv):
|
|||
else:
|
||||
manager.build()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main(sys.argv))
|
||||
|
|
|
@ -29,8 +29,8 @@ def get_orchestration_client():
|
|||
|
||||
def get_args():
|
||||
parser = argparse.ArgumentParser(
|
||||
description=("tripleo-config-download"),
|
||||
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
|
||||
description=("tripleo-config-download"),
|
||||
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
|
||||
parser.add_argument('--stack-name', '-s',
|
||||
default='overcloud',
|
||||
help="Heat stack name")
|
||||
|
@ -41,6 +41,7 @@ def get_args():
|
|||
args = parser.parse_args(sys.argv[1:])
|
||||
return args
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
args = get_args()
|
||||
|
||||
|
|
|
@ -100,6 +100,7 @@ def get_args():
|
|||
args = parser.parse_args(sys.argv[1:])
|
||||
return args
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
args = get_args()
|
||||
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
#!/bin/bash
|
||||
|
||||
build_default_image () {
|
||||
if [ -f /usr/share/openstack-tripleo-common/common/container-images/container_image_prepare_defaults.yaml ]; then
|
||||
local default_file=/usr/share/openstack-tripleo-common/common/container-images/container_image_prepare_defaults.yaml
|
||||
elif [ -f ${BASH_SOURCE%/*}/../container-images/container_image_prepare_defaults.yaml ]; then
|
||||
local default_file=${BASH_SOURCE%/*}/../container-images/container_image_prepare_defaults.yaml
|
||||
else
|
||||
echo "docker.io/openshift/origin-ansible:latest"
|
||||
exit
|
||||
fi
|
||||
local namespace=$(awk '/openshift_namespace:/ {print $2}' $default_file)
|
||||
local prefix=$(awk '/openshift_prefix:/ {print $2}' $default_file)
|
||||
local tag=$(awk '/openshift_tag:/ {print $2}' $default_file)
|
||||
echo ${namespace}/${prefix}-ansible:${tag}
|
||||
if [ -f /usr/share/openstack-tripleo-common/common/container-images/container_image_prepare_defaults.yaml ]; then
|
||||
local default_file=/usr/share/openstack-tripleo-common/common/container-images/container_image_prepare_defaults.yaml
|
||||
elif [ -f ${BASH_SOURCE%/*}/../container-images/container_image_prepare_defaults.yaml ]; then
|
||||
local default_file=${BASH_SOURCE%/*}/../container-images/container_image_prepare_defaults.yaml
|
||||
else
|
||||
echo "docker.io/openshift/origin-ansible:latest"
|
||||
exit
|
||||
fi
|
||||
local namespace=$(awk '/openshift_namespace:/ {print $2}' $default_file)
|
||||
local prefix=$(awk '/openshift_prefix:/ {print $2}' $default_file)
|
||||
local tag=$(awk '/openshift_tag:/ {print $2}' $default_file)
|
||||
echo ${namespace}/${prefix}-ansible:${tag}
|
||||
}
|
||||
|
||||
OPENSHIFT_ANSIBLE_DEFAULT_IMAGE=$(build_default_image)
|
||||
|
@ -43,68 +43,68 @@ OPTS=`getopt -o hd:n:i:p: --long help,config-download-dir:,plan:,image:,playbook
|
|||
eval set -- "$OPTS"
|
||||
|
||||
while true; do
|
||||
case "$1" in
|
||||
-h | --help)
|
||||
usage; exit ;;
|
||||
-d | --config-download-dir)
|
||||
echo "--config-download-dir is deprecated, use --plan instead"
|
||||
shift
|
||||
export CONFIG_DOWNLOAD_DIR=$1; shift ;;
|
||||
-n | --plan)
|
||||
shift
|
||||
export PLAN_NAME=$1
|
||||
shift ;;
|
||||
-p | --playbook)
|
||||
shift
|
||||
export OPENSHIFT_PLAYBOOK=$1; shift ;;
|
||||
-i | --image)
|
||||
shift
|
||||
export OPENSHIFT_ANSIBLE_IMAGE=$1; shift ;;
|
||||
--osa)
|
||||
shift
|
||||
export OPENSHIFT_ANSIBLE_DIR=$1; shift ;;
|
||||
--) shift ; break ;;
|
||||
* ) break ;;
|
||||
esac
|
||||
case "$1" in
|
||||
-h | --help)
|
||||
usage; exit ;;
|
||||
-d | --config-download-dir)
|
||||
echo "--config-download-dir is deprecated, use --plan instead"
|
||||
shift
|
||||
export CONFIG_DOWNLOAD_DIR=$1; shift ;;
|
||||
-n | --plan)
|
||||
shift
|
||||
export PLAN_NAME=$1
|
||||
shift ;;
|
||||
-p | --playbook)
|
||||
shift
|
||||
export OPENSHIFT_PLAYBOOK=$1; shift ;;
|
||||
-i | --image)
|
||||
shift
|
||||
export OPENSHIFT_ANSIBLE_IMAGE=$1; shift ;;
|
||||
--osa)
|
||||
shift
|
||||
export OPENSHIFT_ANSIBLE_DIR=$1; shift ;;
|
||||
--) shift ; break ;;
|
||||
* ) break ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ -z $CONFIG_DOWNLOAD_DIR ]]; then
|
||||
export CONFIG_DOWNLOAD_DIR=/var/lib/mistral/${PLAN_NAME}
|
||||
export CONFIG_DOWNLOAD_DIR=/var/lib/mistral/${PLAN_NAME}
|
||||
fi
|
||||
if [[ ! -d $CONFIG_DOWNLOAD_DIR ]]; then
|
||||
echo "Config-download directory doesn't exist at ${CONFIG_DOWNLOAD_DIR}"
|
||||
exit
|
||||
echo "Config-download directory doesn't exist at ${CONFIG_DOWNLOAD_DIR}"
|
||||
exit
|
||||
fi
|
||||
|
||||
if [[ -z $OPENSHIFT_PLAYBOOK ]]; then
|
||||
export OPENSHIFT_PLAYBOOK=${CONFIG_DOWNLOAD_DIR}/openshift/playbook.yml
|
||||
export OPENSHIFT_PLAYBOOK=${CONFIG_DOWNLOAD_DIR}/openshift/playbook.yml
|
||||
fi
|
||||
|
||||
ANSIBLE_OPTS="-e @${CONFIG_DOWNLOAD_DIR}/openshift/global_vars.yml"
|
||||
if [[ -f ${CONFIG_DOWNLOAD_DIR}/openshift/global_gluster_vars.yml ]]; then
|
||||
ANSIBLE_OPTS="${ANSIBLE_OPTS} -e @${CONFIG_DOWNLOAD_DIR}/openshift/global_gluster_vars.yml"
|
||||
ANSIBLE_OPTS="${ANSIBLE_OPTS} -e @${CONFIG_DOWNLOAD_DIR}/openshift/global_gluster_vars.yml"
|
||||
fi
|
||||
ANSIBLE_OPTS="${ANSIBLE_OPTS} $@"
|
||||
|
||||
if [ -z $OPENSHIFT_ANSIBLE_DIR ]; then
|
||||
sudo podman run \
|
||||
--net=host \
|
||||
-u `id -u` \
|
||||
-v ${CONFIG_DOWNLOAD_DIR}:${CONFIG_DOWNLOAD_DIR}:z \
|
||||
-w ${CONFIG_DOWNLOAD_DIR} \
|
||||
-e ANSIBLE_HOST_KEY_CHECKING=False \
|
||||
-e ANSIBLE_CONFIG=${CONFIG_DOWNLOAD_DIR}/ansible.cfg \
|
||||
-e INVENTORY_DIR=${CONFIG_DOWNLOAD_DIR}/openshift/inventory \
|
||||
-e PLAYBOOK_FILE=${OPENSHIFT_PLAYBOOK} \
|
||||
-e OPTS="${ANSIBLE_OPTS}" \
|
||||
-t ${OPENSHIFT_ANSIBLE_IMAGE}
|
||||
sudo podman run \
|
||||
--net=host \
|
||||
-u `id -u` \
|
||||
-v ${CONFIG_DOWNLOAD_DIR}:${CONFIG_DOWNLOAD_DIR}:z \
|
||||
-w ${CONFIG_DOWNLOAD_DIR} \
|
||||
-e ANSIBLE_HOST_KEY_CHECKING=False \
|
||||
-e ANSIBLE_CONFIG=${CONFIG_DOWNLOAD_DIR}/ansible.cfg \
|
||||
-e INVENTORY_DIR=${CONFIG_DOWNLOAD_DIR}/openshift/inventory \
|
||||
-e PLAYBOOK_FILE=${OPENSHIFT_PLAYBOOK} \
|
||||
-e OPTS="${ANSIBLE_OPTS}" \
|
||||
-t ${OPENSHIFT_ANSIBLE_IMAGE}
|
||||
else
|
||||
pushd ${CONFIG_DOWNLOAD_DIR}
|
||||
ANSIBLE_HOST_KEY_CHECKING=False \
|
||||
ANSIBLE_CONFIG=${CONFIG_DOWNLOAD_DIR}/ansible.cfg \
|
||||
ansible-playbook \
|
||||
-i ${CONFIG_DOWNLOAD_DIR}/openshift/inventory \
|
||||
${ANSIBLE_OPTS} \
|
||||
${OPENSHIFT_PLAYBOOK}
|
||||
popd
|
||||
pushd ${CONFIG_DOWNLOAD_DIR}
|
||||
ANSIBLE_HOST_KEY_CHECKING=False \
|
||||
ANSIBLE_CONFIG=${CONFIG_DOWNLOAD_DIR}/ansible.cfg \
|
||||
ansible-playbook \
|
||||
-i ${CONFIG_DOWNLOAD_DIR}/openshift/inventory \
|
||||
${ANSIBLE_OPTS} \
|
||||
${OPENSHIFT_PLAYBOOK}
|
||||
popd
|
||||
fi
|
||||
|
|
|
@ -127,7 +127,7 @@ class ProcessTemplatesAction(base.TripleOAction):
|
|||
LOG.info("Writing rendered template %s" % yaml_f)
|
||||
swiftutils.put_object_string(swift, self.container, yaml_f,
|
||||
r_template)
|
||||
except swiftexceptions.ClientException as ex:
|
||||
except swiftexceptions.ClientException:
|
||||
error_msg = ("Error storing file %s in container %s"
|
||||
% (yaml_f, self.container))
|
||||
LOG.error(error_msg)
|
||||
|
|
|
@ -48,6 +48,7 @@ def init_prepare_defaults(defaults_file):
|
|||
global CONTAINER_IMAGES_DEFAULTS
|
||||
CONTAINER_IMAGES_DEFAULTS = CONTAINER_IMAGE_PREPARE_PARAM[0]['set']
|
||||
|
||||
|
||||
DEFAULT_TEMPLATE_FILE = os.path.join(sys.prefix, 'share', 'tripleo-common',
|
||||
'container-images',
|
||||
'overcloud_containers.yaml.j2')
|
||||
|
|
|
@ -123,7 +123,7 @@ class Config(object):
|
|||
whenexpr = [whenexpr]
|
||||
for w in whenexpr:
|
||||
# make \|int optional incase forgotten; use only step digit:
|
||||
match = re.search('step(\|int)? == ([0-9]+)$', "%s" % w)
|
||||
match = re.search(r'step(\|int)? == ([0-9]+)$', "%s" % w)
|
||||
if match:
|
||||
if match.group(2) == str(step):
|
||||
return True
|
||||
|
|
|
@ -306,29 +306,29 @@ DRIVER_INFO = {
|
|||
hardware_type='idrac'),
|
||||
'(ilo|.*_ilo)': PrefixedDriverInfo('ilo', has_port=True,
|
||||
hardware_type='ilo'),
|
||||
'(cisco\-ucs\-managed|.*_ucs)': UcsDriverInfo(),
|
||||
r'(cisco\-ucs\-managed|.*_ucs)': UcsDriverInfo(),
|
||||
'(irmc|.*_irmc)': PrefixedDriverInfo('irmc', has_port=True,
|
||||
hardware_type='irmc'),
|
||||
'redfish': RedfishDriverInfo(),
|
||||
'xclarity': PrefixedDriverInfo('xclarity', has_port=True),
|
||||
# test drivers
|
||||
'staging\-ovirt': oVirtDriverInfo(),
|
||||
'(staging\-iboot|.*_iboot)': iBootDriverInfo(),
|
||||
'(staging\-wol|.*wol)': DriverInfo(
|
||||
r'staging\-ovirt': oVirtDriverInfo(),
|
||||
r'(staging\-iboot|.*_iboot)': iBootDriverInfo(),
|
||||
r'(staging\-wol|.*wol)': DriverInfo(
|
||||
'wol',
|
||||
mapping={
|
||||
'pm_addr': 'wol_host',
|
||||
'pm_port': 'wol_port',
|
||||
},
|
||||
hardware_type='staging-wol'),
|
||||
'(staging\-amt|.*_amt)': PrefixedDriverInfo('amt',
|
||||
hardware_type='staging-amt'),
|
||||
r'(staging\-amt|.*_amt)': PrefixedDriverInfo('amt',
|
||||
hardware_type='staging-amt'),
|
||||
# fake_pxe was used when no management interface was supported, now
|
||||
# manual-management is used for the same purpose
|
||||
'(manual\-management|fake_pxe|fake_agent)': DriverInfo(
|
||||
r'(manual\-management|fake_pxe|fake_agent)': DriverInfo(
|
||||
'fake', mapping={}, hardware_type='manual-management'),
|
||||
'^fake(|\-hardware)$': DriverInfo('fake', mapping={},
|
||||
hardware_type='fake-hardware'),
|
||||
r'^fake(|\-hardware)$': DriverInfo('fake', mapping={},
|
||||
hardware_type='fake-hardware'),
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -60,6 +60,7 @@ def bracket_ipv6(address):
|
|||
except socket.error:
|
||||
return address
|
||||
|
||||
|
||||
CLEAR_ENV = """# Clear any old environment that may conflict.
|
||||
for key in $( set | awk '{FS=\"=\"} /^OS_/ {print $1}' ); do unset $key ; done
|
||||
"""
|
||||
|
@ -67,7 +68,7 @@ CLOUDPROMPT = """
|
|||
# Add OS_CLOUDNAME to PS1
|
||||
if [ -z "${CLOUDPROMPT_ENABLED:-}" ]; then
|
||||
export PS1=${PS1:-""}
|
||||
export PS1=\${OS_CLOUDNAME:+"(\$OS_CLOUDNAME)"}\ $PS1
|
||||
export PS1=\\${OS_CLOUDNAME:+"(\\$OS_CLOUDNAME)"}\\ $PS1
|
||||
export CLOUDPROMPT_ENABLED=1
|
||||
fi
|
||||
"""
|
||||
|
|
|
@ -29,14 +29,14 @@ def execute(*cmd, **kwargs):
|
|||
Executes and logs results from a system command. See docs for
|
||||
oslo_concurrency.processutils.execute for usage.
|
||||
|
||||
:param \*cmd: positional arguments to pass to processutils.execute()
|
||||
:param \\*cmd: positional arguments to pass to processutils.execute()
|
||||
:param use_standard_locale: keyword-only argument. True | False.
|
||||
Defaults to False. If set to True,
|
||||
execute command with standard locale
|
||||
added to environment variables.
|
||||
:param log_stdout: keyword-only argument. True | False. Defaults
|
||||
to True. If set to True, logs the output.
|
||||
:param \*\*kwargs: keyword arguments to pass to processutils.execute()
|
||||
:param \\*\\*kwargs: keyword arguments to pass to processutils.execute()
|
||||
:returns: (stdout, stderr) from process execution
|
||||
:raises: UnknownArgumentError on receiving unknown arguments
|
||||
:raises: ProcessExecutionError
|
||||
|
|
Loading…
Reference in New Issue