cmd.py: tweak plugin information querying logic
We don't want to unconditionally disable plugin querying just because --conf is not given. That would mean that the query_plugins_info field in the default paths would always be ignored, even if set to True. This patch tweaks the logic so that we remember in options.conf the actual name of the config file that we read from, whether it be from --conf or from one of the default paths. This way, the `test` command will still work out of the box, as commit f68831b envisioned. But query_plugins_info is now checked if the user has a configuration file (whether it be a default one, or one specified through --conf). Change-Id: Id71ad207f0419f7cc52eca174dd859d4182d7250 Story: 2000387
This commit is contained in:
parent
55fa8fda09
commit
72b259c845
@ -76,10 +76,10 @@ jenkins section
|
|||||||
By default this is set to the system configured socket timeout.
|
By default this is set to the system configured socket timeout.
|
||||||
|
|
||||||
**query_plugins_info**
|
**query_plugins_info**
|
||||||
Whether to query the Jenkins instance for plugin info when a configuration
|
Whether to query the Jenkins instance for plugin info. If no configuration
|
||||||
file is provided. If a configuration file is not provided `jenkins-jobs` will
|
files are found (either in the default paths or given through the
|
||||||
ignore this setting and skip querying for plugin information. True by
|
command-line), `jenkins-jobs` will skip querying for plugin information. True
|
||||||
default.
|
by default.
|
||||||
|
|
||||||
|
|
||||||
hipchat section
|
hipchat section
|
||||||
|
@ -187,6 +187,7 @@ def setup_config_settings(options):
|
|||||||
# Load default config always
|
# Load default config always
|
||||||
config.readfp(StringIO(DEFAULT_CONF))
|
config.readfp(StringIO(DEFAULT_CONF))
|
||||||
if os.path.isfile(conf):
|
if os.path.isfile(conf):
|
||||||
|
options.conf = conf # remember file we read from
|
||||||
logger.debug("Reading config from {0}".format(conf))
|
logger.debug("Reading config from {0}".format(conf))
|
||||||
conffp = io.open(conf, 'r', encoding='utf-8')
|
conffp = io.open(conf, 'r', encoding='utf-8')
|
||||||
config.readfp(conffp)
|
config.readfp(conffp)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user