[config_drive] Fix conditional to handle NoneType properly#3683
[config_drive] Fix conditional to handle NoneType properly#3683holser wants to merge 1 commit intoopenstack-k8s-operators:mainfrom
Conversation
Replace explicit 'is not none' check with default filter for None safety. Ansible 2.16+ requires conditionals to return boolean values, not NoneType. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Sergii Golovatiuk <sgolovat@redhat.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/efbd14b3673b443b9866353ec72e1d11 ✔️ openstack-k8s-operators-content-provider SUCCESS in 1h 37m 58s |
| - name: Generate network-data | ||
| register: _net_data_change | ||
| when: | ||
| - cifmw_config_drive_networkconfig is not none |
There was a problem hiding this comment.
This is not needed.
The varialbe is defined in the role default, see: https://github.com/openstack-k8s-operators/ci-framework/blob/main/roles/config_drive/defaults/main.yml#L31-L32 - so it will be None or some value the user provided. The is not none test is safe here.
Replace explicit 'is not none' check with default filter for None safety. Ansible 2.16+ requires conditionals to return boolean values, not NoneType.