diff options
author | Darragh Bailey <dbailey@hpe.com> | 2016-07-22 16:55:27 +0100 |
---|---|---|
committer | Darragh Bailey <dbailey@hpe.com> | 2016-07-22 17:55:22 +0100 |
commit | 652806a7513d017529774854965cf41ad60f6ef1 (patch) | |
tree | c609944d5a949a326f527291c9de1f71dc8d6341 /jenkins_jobs/config.py | |
parent | 4f04de1f9ad706971f12508dacee5332df0a3a11 (diff) | |
download | python-jenkins-job-builder-652806a7513d017529774854965cf41ad60f6ef1.tar.gz python-jenkins-job-builder-652806a7513d017529774854965cf41ad60f6ef1.tar.xz python-jenkins-job-builder-652806a7513d017529774854965cf41ad60f6ef1.zip |
Ensure flush cache option obeyed
Make sure that flush cache is correct set first by config file, and
additionally that the CLI overrides any defaults.
In the V2 API work, when moving code around the flush cache option was
accidentally removed from being set by the command line or config
files. This ensures it follows the same behaviour as other similar
options.
Change-Id: I9fb1e234e5ed081ada64855389a87d2f7555469e
Diffstat (limited to 'jenkins_jobs/config.py')
-rw-r--r-- | jenkins_jobs/config.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/jenkins_jobs/config.py b/jenkins_jobs/config.py index 2ec2c87d..fce03663 100644 --- a/jenkins_jobs/config.py +++ b/jenkins_jobs/config.py @@ -160,8 +160,7 @@ class JJBConfig(object): logger.debug("Config: {0}".format(config)) - # check the ignore_cache setting: first from command line, - # if not present check from ini file + # check the ignore_cache setting if config.has_option('jenkins', 'ignore_cache'): logging.warn('''ignore_cache option should be moved to the [job_builder] section in the config file, the one @@ -172,6 +171,10 @@ class JJBConfig(object): self.ignore_cache = config.getboolean('job_builder', 'ignore_cache') + # check the flush_cache setting + if config.has_option('job_builder', 'flush_cache'): + self.flush_cache = config.getboolean('job_builder', 'flush_cache') + # Jenkins supports access as an anonymous user, which can be used to # ensure read-only behaviour when querying the version of plugins # installed for test mode to generate XML output matching what will be |