Can't use variable to set bool fields
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Core Infrastructure |
Fix Committed
|
Undecided
|
Khai Do |
Bug Description
Trying to set bool field in a job-template using a variable doesn't work. This is caused by a combination of limitations:
1. brackets for a variable reference need to be enclosed in single-quotes or the variable ref will be mis-interrupted by the YAML parser as a YAML dictionary. '{var_ref}' not {var_ref}
2. With the single quotes around the variable reference the value is converted to a string. For the specific boolean fields (disabled, block-downstream, block-upstream), any string value results in a boolean value true. The values '', 'true', 'false' all result in a true value in the geneted XML.
Boolean fields should be able to accept string values such as 'true' or 'False'. The following is a snippet of YAML to demonstrate the problem:
- job-template:
name: 'test_project'
disabled: '{disabled}'
-project:
name: test_project
jobs:
- 'test_job':
disabled: true
The problem can be traced to the file jenkins_
disabled
block-downstream
block-upstream
Changed in openstack-ci: | |
assignee: | nobody → Ryan Carey (rcarey) |
Changed in openstack-ci: | |
status: | In Progress → Invalid |
Fix proposed to branch: master /review. openstack. org/104294
Review: https:/