Convert multiline strings to concatenated single-quote.

Change-Id: Ic0c1be9ca037b67695136583837702d3ec4d42a8
This commit is contained in:
Wayne Warren 2016-08-05 06:38:23 -07:00 committed by Thanh Ha
parent e1de6f22ff
commit e93f4a5f5a
No known key found for this signature in database
GPG Key ID: B0CB27E00DA095AA
6 changed files with 31 additions and 31 deletions

@ -32,52 +32,51 @@ def create_parser():
parser.add_argument( parser.add_argument(
'--conf', '--conf',
dest='conf', dest='conf',
help='''configuration file''') help="configuration file")
parser.add_argument( parser.add_argument(
'-l', '-l',
'--log_level', '--log_level',
dest='log_level', dest='log_level',
default='info', default='info',
help='''log level (default: %(default)s)''') help="log level (default: %(default)s)")
parser.add_argument( parser.add_argument(
'--ignore-cache', '--ignore-cache',
action='store_true', action='store_true',
dest='ignore_cache', dest='ignore_cache',
default=None, default=None,
help='''ignore the cache and update the jobs anyhow (that will only help="ignore the cache and update the jobs anyhow (that will "
flush the specified jobs cache)''') "only flush the specified jobs cache)")
parser.add_argument( parser.add_argument(
'--flush-cache', '--flush-cache',
action='store_true', action='store_true',
dest='flush_cache', dest='flush_cache',
default=None, default=None,
help='''flush all the cache entries before updating''') help="flush all the cache entries before updating")
parser.add_argument( parser.add_argument(
'--version', '--version',
dest='version', dest='version',
action='version', action='version',
version=__version__(), version=__version__(),
help='''show version''') help="show version")
parser.add_argument( parser.add_argument(
'--allow-empty-variables', '--allow-empty-variables',
action='store_true', action='store_true',
dest='allow_empty_variables', dest='allow_empty_variables',
default=None, default=None,
help='''Don\'t fail if any of the variables inside any string are help="Don\'t fail if any of the variables inside any string are "
not defined, replace with empty string instead.''') "not defined, replace with empty string instead.")
parser.add_argument( parser.add_argument(
'--user', '-u', '--user', '-u',
help='''The Jenkins user to use for authentication. This overrides help="The Jenkins user to use for authentication. This overrides "
the user specified in the configuration file.''') "the user specified in the configuration file.")
parser.add_argument( parser.add_argument(
'--password', '-p', '--password', '-p',
help='''Password or API token to use for authenticating towards help="Password or API token to use for authenticating towards Jenkins."
Jenkins. This overrides the password specified in the configuration " This overrides the password specified in the configuration file.")
file.''')
subparser = parser.add_subparsers( subparser = parser.add_subparsers(
dest='command', dest='command',
help='''update, test or delete job''') help="update, test or delete job")
extension_manager = extension.ExtensionManager( extension_manager = extension.ExtensionManager(
namespace='jjb.cli.subcommands', namespace='jjb.cli.subcommands',

@ -56,12 +56,12 @@ class BaseSubCommand(object):
action='store_true', action='store_true',
dest='recursive', dest='recursive',
default=False, default=False,
help='''look for yaml files recursively''') help="look for yaml files recursively")
parser.add_argument( parser.add_argument(
'-x', '--exclude', '-x', '--exclude',
dest='exclude', dest='exclude',
action='append', action='append',
default=[], default=[],
help='''paths to exclude when using recursive search, uses standard help="paths to exclude when using recursive search, "
globbing.''') "uses standard globbing.")

@ -34,8 +34,8 @@ class DeleteSubCommand(base.BaseSubCommand):
delete.add_argument( delete.add_argument(
'-p', '--path', '-p', '--path',
default=None, default=None,
help='''colon-separated list of paths to YAML files or help="colon-separated list of paths to YAML files "
directories''') "or directories")
def execute(self, options, jjb_config): def execute(self, options, jjb_config):
builder = JenkinsManager(jjb_config) builder = JenkinsManager(jjb_config)

@ -30,8 +30,8 @@ class DeleteAllSubCommand(base.BaseSubCommand):
def parse_args(self, subparser): def parse_args(self, subparser):
delete_all = subparser.add_parser( delete_all = subparser.add_parser(
'delete-all', 'delete-all',
help='''delete *ALL* jobs from Jenkins server, including those not help="delete *ALL* jobs from Jenkins server, including "
managed by Jenkins Job Builder.''') "those not managed by Jenkins Job Builder.")
self.parse_option_recursive_exclude(delete_all) self.parse_option_recursive_exclude(delete_all)

@ -35,8 +35,8 @@ class UpdateSubCommand(base.BaseSubCommand):
'path', 'path',
nargs='?', nargs='?',
default=sys.stdin, default=sys.stdin,
help='''colon-separated list of paths to YAML files or help="colon-separated list of paths to YAML files "
directories''') "or directories")
def parse_arg_names(self, parser): def parse_arg_names(self, parser):
parser.add_argument( parser.add_argument(
@ -62,8 +62,8 @@ class UpdateSubCommand(base.BaseSubCommand):
type=int, type=int,
default=1, default=1,
dest='n_workers', dest='n_workers',
help='''number of workers to use, 0 for autodetection and 1 for help="number of workers to use, 0 for autodetection and 1 "
just one worker.''') "for just one worker.")
def _generate_xmljobs(self, options, jjb_config=None): def _generate_xmljobs(self, options, jjb_config=None):
builder = JenkinsManager(jjb_config) builder = JenkinsManager(jjb_config)

@ -159,8 +159,9 @@ class JJBConfig(object):
logger.debug("Reading config from {0}".format(config_filename)) logger.debug("Reading config from {0}".format(config_filename))
config_fp = io.open(config_filename, 'r', encoding='utf-8') config_fp = io.open(config_filename, 'r', encoding='utf-8')
else: else:
raise JJBConfigException("""A valid configuration file is required. raise JJBConfigException(
\n{0} is not valid.""".format(config_filename)) "A valid configuration file is required. "
"\n{0} is not valid.".format(config_filename))
return config_fp return config_fp
@ -171,10 +172,10 @@ class JJBConfig(object):
# check the ignore_cache setting # check the ignore_cache setting
if config.has_option('jenkins', 'ignore_cache'): if config.has_option('jenkins', 'ignore_cache'):
logging.warn('''ignore_cache option should be moved to the logging.warn("ignore_cache option should be moved to the "
[job_builder] section in the config file, the one "[job_builder] section in the config file, the "
specified in the [jenkins] section will be ignored in "one specified in the [jenkins] section will be "
the future''') "ignored in the future")
self.ignore_cache = config.getboolean('jenkins', 'ignore_cache') self.ignore_cache = config.getboolean('jenkins', 'ignore_cache')
elif config.has_option('job_builder', 'ignore_cache'): elif config.has_option('job_builder', 'ignore_cache'):
self.ignore_cache = config.getboolean('job_builder', self.ignore_cache = config.getboolean('job_builder',