diff options
author | James E. Blair <jeblair@openstack.org> | 2014-04-29 11:44:55 -0700 |
---|---|---|
committer | James E. Blair <jeblair@openstack.org> | 2014-04-29 11:44:55 -0700 |
commit | 2c520ddf07b6824f12c32ba9ffce13315bde9cc1 (patch) | |
tree | ea2c983afdeecdcf7c4e150018c05ede46a1ae46 | |
parent | 2b2037d878891d40007b433b16657cad7f7d5273 (diff) | |
download | python-jenkins-job-builder-2c520ddf07b6824f12c32ba9ffce13315bde9cc1.tar.gz python-jenkins-job-builder-2c520ddf07b6824f12c32ba9ffce13315bde9cc1.tar.xz python-jenkins-job-builder-2c520ddf07b6824f12c32ba9ffce13315bde9cc1.zip |
Treat ignore_cache as a boolean
When ignore_cache was loaded from the config file (including the
default config) it was treated as a string, which evaluates to
true in boolean expressions. Therefore, unless ignore_cache was
set on the command line, it would always behave as if true.
Fix by asking configparser for a boolean value.
Change-Id: I63af8637671248fc1a6895d1eb82f1c2e24ce5c2
-rwxr-xr-x | jenkins_jobs/cmd.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/jenkins_jobs/cmd.py b/jenkins_jobs/cmd.py index 41e9de59..ebba9939 100755 --- a/jenkins_jobs/cmd.py +++ b/jenkins_jobs/cmd.py @@ -118,9 +118,9 @@ def main(): logging.warn('ignore_cache option should be moved to the [job_builder]' ' section in the config file, the one specified in the ' '[jenkins] section will be ignored in the future') - ignore_cache = config.get('jenkins', 'ignore_cache') + ignore_cache = config.getboolean('jenkins', 'ignore_cache') elif config.has_option('job_builder', 'ignore_cache'): - ignore_cache = config.get('job_builder', 'ignore_cache') + ignore_cache = config.getboolean('job_builder', 'ignore_cache') # workaround for python 2.6 interpolation error # https://bugs.launchpad.net/openstack-ci/+bug/1259631 |