Bug 1698184 - Null Coalescing fields don't work as input Parameters
Summary: Null Coalescing fields don't work as input Parameters
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Automate
Version: 5.10.3
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: GA
: 5.11.0
Assignee: Lucy Fu
QA Contact: Ganesh Hubale
Red Hat CloudForms Documentation
URL:
Whiteboard:
: 1696220 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-04-09 18:30 UTC by William Fitzgerald
Modified: 2019-12-12 13:36 UTC (History)
10 users (show)

Fixed In Version: 5.11.0.21
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-12-12 13:36:21 UTC
Category: Bug
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
export of domain for testing null coalescing problem (10.03 KB, application/zip)
2019-04-10 18:13 UTC, William Fitzgerald
no flags Details
null coalescing schema setup (54.94 KB, image/png)
2019-04-10 18:16 UTC, William Fitzgerald
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:4199 0 None None None 2019-12-12 13:36:35 UTC

Description William Fitzgerald 2019-04-09 18:30:59 UTC
Description of problem: Null Coalescing fields don't work as input Parameters to Ruby methods or Ansible playbooks


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

How reproducible:
100%

Steps to Reproduce:
1.  Create a Ruby method or Ansible playbook method with Input Parameters.
2.  Use Data Type null coalescing
3.  Make the default value something like this : ${#var3} || ${#var2} || ${#var1}

Actual results:
Invoking [inline] method [/billy/System/Request2/null_col_test_ruby_method] with inputs [{"dialog_var1"=>" || var2_value || var1_value", "dialog_var2"=>"var1_value || var2_value || "}]

Expected results:
normal null coalescing behavior

Additional info:

Reproducer: 10.8.198.63 
Run null_col_test_ruby_method from Automate/Simulation

Comment 3 William Fitzgerald 2019-04-10 18:13:14 UTC
Created attachment 1554338 [details]
export of domain for testing null coalescing problem

Import, Enable domain and run simulation for the 2 instances.  If you tail/view the automation log you should see Fred and Barney as the correct values.

Comment 4 William Fitzgerald 2019-04-10 18:16:06 UTC
Created attachment 1554340 [details]
null coalescing schema setup

Comment 5 William Fitzgerald 2019-04-10 18:21:27 UTC
Ganesh,

I included a domain and instructions for your testing.

Bad : Invoking [inline] method [/null_coalescing/System/Request/null_col_fails] with inputs [{"arg1"=>"fred ||barney ||"}]

Good : Invoking [inline] method [/null_coalescing/System/Request/null_col_workaround] with inputs [{"arg1"=>"fred", "arg2"=>"barney"}]

Let me know if you need anything else 

THanks

Billy

Comment 7 Tina Fitzgerald 2019-06-06 20:32:21 UTC
Hi Lucy,

Please discuss with Madhu.

Thanks,
Tina

Comment 8 Tina Fitzgerald 2019-06-06 21:11:37 UTC
*** Bug 1696220 has been marked as a duplicate of this bug. ***

Comment 10 CFME Bot 2019-08-21 16:03:34 UTC
New commit detected on ManageIQ/manageiq-automation_engine/master:

https://github.com/ManageIQ/manageiq-automation_engine/commit/d3c2f6dd60238ec1d917a7bd56dc399f0db695be
commit d3c2f6dd60238ec1d917a7bd56dc399f0db695be
Author:     Lucy Fu <lufu>
AuthorDate: Mon Jul  1 10:15:05 2019 -0400
Commit:     Lucy Fu <lufu>
CommitDate: Mon Jul  1 10:15:05 2019 -0400

    Fix the issue with null coalescing fields as input parameters.

    https://bugzilla.redhat.com/show_bug.cgi?id=1698184

 lib/miq_automation_engine/engine/miq_ae_engine/miq_ae_method.rb | 2 +-
 lib/miq_automation_engine/engine/miq_ae_engine/miq_ae_object.rb | 16 +-
 spec/miq_ae_method_spec.rb | 24 +
 3 files changed, 32 insertions(+), 10 deletions(-)

Comment 11 CFME Bot 2019-08-21 20:27:53 UTC
New commit detected on ManageIQ/manageiq-automation_engine/ivanchuk:

https://github.com/ManageIQ/manageiq-automation_engine/commit/abc51bc36a668bd672eb061033b84d070011d122
commit abc51bc36a668bd672eb061033b84d070011d122
Author:     Greg McCullough <gmccullo>
AuthorDate: Wed Aug 21 12:01:25 2019 -0400
Commit:     Greg McCullough <gmccullo>
CommitDate: Wed Aug 21 12:01:25 2019 -0400

    Merge pull request #334 from lfu/null_coalescing_1698184

    Fix the issue with null coalescing fields as input parameters.

    (cherry picked from commit 69b58ee4ce23eef1591a90c145e8b225821a80b9)

    https://bugzilla.redhat.com/show_bug.cgi?id=1698184

 lib/miq_automation_engine/engine/miq_ae_engine/miq_ae_method.rb | 2 +-
 lib/miq_automation_engine/engine/miq_ae_engine/miq_ae_object.rb | 16 +-
 spec/miq_ae_method_spec.rb | 24 +
 3 files changed, 32 insertions(+), 10 deletions(-)

Comment 12 Ganesh Hubale 2019-08-27 13:54:01 UTC
Fixed!

Verified on version: 5.11.0.21.20190821214526_b0060d0

Automation Logs:
================
[----] I, [2019-08-27T09:50:50.848562 #7952:2b117853f778]  INFO -- : Updated namespace [JDLhjVMjbX/VFbOtbkLZw/fihmsuvlzb  jQWuYXXAtY/JDLhjVMjbX]

[----] I, [2019-08-27T09:50:50.854358 #7952:2b117853f778]  INFO -- : Invoking [inline] method [/jQWuYXXAtY/JDLhjVMjbX/VFbOtbkLZw/fIHmsuVlZB] with inputs [{"arg1"=>"fred", "arg2"=>"george"}]

[----] I, [2019-08-27T09:50:50.862274 #7952:2b117853f778]  INFO -- : <AEMethod [/jQWuYXXAtY/JDLhjVMjbX/VFbOtbkLZw/fIHmsuVlZB]> Starting 
[----] I, [2019-08-27T09:50:51.319402 #7952:2b117af4011c]  INFO -- : <AEMethod fihmsuvlzb> Hello world
[----] I, [2019-08-27T09:50:51.338308 #7952:2b117853f778]  INFO -- : <AEMethod [/jQWuYXXAtY/JDLhjVMjbX/VFbOtbkLZw/fIHmsuVlZB]> Ending
[----] I, [2019-08-27T09:50:51.338472 #7952:2b117853f778]  INFO -- : Method exited with rc=MIQ_OK
[

Comment 13 Lucy Fu 2019-08-27 15:23:36 UTC
Ganesh,

Could you help test the issue reported by http://talk.manageiq.org/t/automate-expression-methods/3071/8?
Thanks.

Comment 14 Ganesh Hubale 2019-08-28 11:42:25 UTC
Hi Lucy,

I can see that you and @mkanoor has already replied to that issue.

Hence clearing need info.

Thanks,
Ganesh

Comment 16 errata-xmlrpc 2019-12-12 13:36:21 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:4199


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