Bug 1696220 - CloudForms Null Coalescing fields in Ansible Playbook Methods do not Coalesce
Summary: CloudForms Null Coalescing fields in Ansible Playbook Methods do not Coalesce
Keywords:
Status: CLOSED DUPLICATE of bug 1698184
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Automate
Version: 5.9.9
Hardware: All
OS: Linux
low
low
Target Milestone: GA
: cfme-future
Assignee: William Fitzgerald
QA Contact: Satyajit Bulage
Red Hat CloudForms Documentation
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-04-04 11:20 UTC by Chris Ruffalo
Modified: 2023-09-14 05:26 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-06-06 21:11:37 UTC
Category: ---
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
null coalescing 1 (54.94 KB, image/png)
2019-04-11 17:58 UTC, William Fitzgerald
no flags Details
null coalescing workaround (32.69 KB, image/png)
2019-04-11 17:59 UTC, William Fitzgerald
no flags Details

Description Chris Ruffalo 2019-04-04 11:20:08 UTC
Description of problem:
Null coalescing fields do not work as input to Ansible Playbook method.


Version-Release number of selected component (if applicable):
5.9.9.1


How reproducible:
I have only encountered it in one test workflow but I believe it would be the same for all Ansible Playbook Methods


Steps to Reproduce:
1. Create a playbook that outputs a method parameter, say `input_field`
2. Create a playbook method that uses `${/#input_field} || "default"` as a method parameter
3. Simulate method execution with input_field = "new value"
4. Observe the output is 'new value || "default"'

Alternate Steps:
1. Import https://github.com/chrisruffalo/cfme-null-coalesce-issue.git as an Ansible repository with the EXACT name "CFME Null Coalesce Issue"
2. Import https://github.com/chrisruffalo/cfme-null-coalesce-issue.git as a Domain from the branch origin/master
3. Simulate the execution of `NullCoalesceAnsible` with the attribute/value pair { input_field => new value }
4. Observe the output of input_field is 'new value || "default"'
5. For comparison observe the output of input_field2 which is null coalesced in the instance


Actual results:
Null coalescing field has all non-null options

Expected results:
Null coalescing field should only have non-null options

Additional info:
https://github.com/chrisruffalo/cfme-null-coalesce-issue

Comment 2 William Fitzgerald 2019-04-11 17:57:25 UTC
Chris,

Null Coalescing fields don't work as input Parameters for Ansible methods and inline methods currently.
I opened a new BZ for this: https://bugzilla.redhat.com/show_bug.cgi?id=1698184

As a workaround, you can setup the null coalescing field in the instance and then use that in the input parameters.

I am going to include a couple of screenshots.  If you want, I have a domain export that I can include that has the workaround
included for both inline method and ansible method.

Thanks

Billy

Comment 3 William Fitzgerald 2019-04-11 17:58:25 UTC
Created attachment 1554615 [details]
null coalescing 1

Comment 4 William Fitzgerald 2019-04-11 17:59:20 UTC
Created attachment 1554616 [details]
null coalescing workaround

Comment 5 Chris Ruffalo 2019-04-12 01:45:57 UTC
Billy,

Thanks for taking the time to respond. In the domain I linked in the GitHub repository the difference is demonstrated with the different variables/values. I have a null coalescing field in the instance and then use the same pattern to null coalesce in the method parameter.

I'm using the workaround now but it diminishes the value of the shared code and being able to call it from anywhere because I've got to modify schemas where I have this issue. (I'm making drop-in replacements for existing automation from Embedded Ansible.)

Also, thank you for taking the time to test it with a Ruby method which I hadn't done in my domain.

Chris

Comment 6 William Fitzgerald 2019-04-12 19:54:37 UTC
Chris,

Are you ok with me marking this BZ as a duplicate of mine and closing it ?
I will track this issue for both cases with my BZ : https://bugzilla.redhat.com/show_bug.cgi?id=1698184

Please let me know

Comment 7 Tina Fitzgerald 2019-06-06 21:11:37 UTC

*** This bug has been marked as a duplicate of bug 1698184 ***

Comment 8 Red Hat Bugzilla 2023-09-14 05:26:30 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days


Note You need to log in before you can comment on or make changes to this bug.