Bug 1565925

Summary: The value that is selected in the drop down is not passed to the $evm.root
Product: Red Hat CloudForms Management Engine Reporter: Imaan <ikaur>
Component: AutomateAssignee: eclarizi
Status: CLOSED ERRATA QA Contact: Yadnyawalk Tale <ytale>
Severity: high Docs Contact:
Priority: high    
Version: 5.9.0CC: cpelland, duhlmann, gmccullo, greartes, ikaur, jprause, mkanoor, obarenbo, simaishi, smallamp, sshveta, tfitzger, ytale
Target Milestone: GAKeywords: Regression, ZStream
Target Release: 5.9.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-07-12 13:14:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1561041    
Attachments:
Description Flags
datastore_2018_04_13.zip
none
dialog_export_20180413_152646.yml
none
automation.log none

Description Imaan 2018-04-11 04:30:44 UTC
Description of problem:

The value that is selected in the drop-down is not passed to the $evm.root

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

5.9.0.22.20180221205805_f93a675

How reproducible:

Always

Steps to Reproduce:

1. Create a dialog with a dynamic dropdown

2. Create a catalog item that implements the dialog

3. Select an item in the drop-down while ordering a service

4. Click on submit at last.

5. #tailf the automation.log file 


Actual results: When I select "ten" from the drop-down and that value "ten" is not passed to the $evm.root. For example:

Selected "ten" value that is of string data type from the drop-down and the value passed i.e 0 as shown the result for example "dialog_enviroment=0"

Result : 

~~~

----] I, [2018-04-11T00:25:05.424048 #2216:4e89550]  INFO -- : Updated namespace [/ImaanN/ImaanC/testI?MiqServer%3A%3Amiq_server=36000000000001&ServiceTemplate%3A%3Aservice_template=36000000000007&User%3A%3Auser=36000000000001&dialog_enviroment=0&object_name=testI&vmdb_object_type=service_template  Imaan/ImaanN]

~~~


Expected results: It should pass the selected value from the drop-down.

Comment 3 eclarizi 2018-04-11 16:08:01 UTC
Can you either provide a reproducing appliance or an export of the dialog and automate methods? I can't seem to reproduce on the latest master nor on a 5.9.0.22 appliance with a basic dialog and automate method I took from here: http://manageiq.org/docs/reference/latest/doc-Scripting_Actions/miq/index#creating-a-dynamic-content-dialog.

Comment 4 Sudhir Mallamprabhakara 2018-04-13 13:53:26 UTC
Ytale - Can you try to re-create and provide the appliance pls??

- Sudhir

Comment 5 Yadnyawalk Tale 2018-04-13 15:34:09 UTC
Created attachment 1421425 [details]
datastore_2018_04_13.zip

Hi,

Reproduce issue with following steps:

1. Import attached datastore (select 'our_domain')
2. Enable domain
3. Import attached dialog
4. Create generic catalog_item and attach dialog to it
5. Select, let say "ten" value from dropdown
6. Order it
7. Check automation.log for 'dialog_enviroment' thing


Mentioned issue has been reproduced on: 5.9.1.1, 5.9.2.0, 5.9.2.2

Comment 6 Yadnyawalk Tale 2018-04-13 15:34:40 UTC
Created attachment 1421426 [details]
dialog_export_20180413_152646.yml

Comment 8 Greg McCullough 2018-04-16 20:24:10 UTC
While there does appear to be an issue here it does not appear to effect the data passed to the provisioning state-machine for the service.

Running the reproduction steps we can see an extra call to the method.  We believe this issue will be address in the changes being made for BZ https://bugzilla.redhat.com/show_bug.cgi?id=1559757.

Testing against the 5.9.2.2 appliance I am seeing the proper dialog field data being passed to the state-machine:

[----] I, [2018-04-16T15:59:28.393942 #12023:1027118]  INFO -- : Q-task_id([service_template_provision_task_8]) Instantiating [/Service/Provisioning/StateMachines/ServiceProvision_Template/CatalogItemInitialization?MiqServer%3A%3Amiq_server=1&Service%3A%3AService=8&ServiceTemplateProvisionTask%3A%3Aservice_template_provision_task=8&User%3A%3Auser=1&dialog_enviroment=10&object_name=CatalogItemInitialization&request=clone_to_service&service_action=Provision&vmdb_object_type=service_template_provision_task]

(See that "dialog_enviroment=10" is passed in the above logging line.)

A little further down we also see the following logging:
[----] I, [2018-04-16T15:59:31.120120 #12023:1291de0]  INFO -- : <AEMethod groupsequencecheck>  dialog_enviroment: 10


We should keep this issue open for now and re-evaluate once a fix for bug 1559757 is available.

Comment 9 Yadnyawalk Tale 2018-04-17 06:36:46 UTC
Created attachment 1422915 [details]
automation.log

Good catch Greg! Earlier investigation was based on first two calls and I missed third one which was valid call. 

Before submitting order request, there are some extra calls for invalid selections; but after submitting request, 'valid-values' getting passed at the end too.


Selected 10, passing 0 (before request get submited)
======================================================

[----] I, [2018-04-17T01:50:48.539895 #12136:160b3e0]  INFO -- : Instantiating [/namespace/class1/instance1?MiqServer%3A%3Amiq_server=1&ServiceTemplate%3A%3Aservice_template=1&User%3A%3Auser=1&dialog_enviroment=0&object_name=instance1&vmdb_object_type=service_template]
[----] I, [2018-04-17T01:50:48.557682 #12136:160b3e0]  INFO -- : Updated namespace [/namespace/class1/instance1?MiqServer%3A%3Amiq_server=1&ServiceTemplate%3A%3Aservice_template=1&User%3A%3Auser=1&dialog_enviroment=0&object_name=instance1&vmdb_object_type=service_template  dialog/namespace]


Selected 10, passing 2 (before request get submited)
======================================================

[----] I, [2018-04-17T01:50:49.456534 #12136:160b3e0]  INFO -- : Instantiating [/namespace/class1/instance1?MiqServer%3A%3Amiq_server=1&ServiceTemplate%3A%3Aservice_template=1&User%3A%3Auser=1&dialog_enviroment=2&object_name=instance1&vmdb_object_type=service_template]
[----] I, [2018-04-17T01:50:49.470705 #12136:160b3e0]  INFO -- : Updated namespace [/namespace/class1/instance1?MiqServer%3A%3Amiq_server=1&ServiceTemplate%3A%3Aservice_template=1&User%3A%3Auser=1&dialog_enviroment=2&object_name=instance1&vmdb_object_type=service_template  dialog/namespace]


Selected 10, passing 10 (after selection)
=========================================

[----] I, [2018-04-17T01:51:07.429868 #12136:160b818]  INFO -- : Instantiating [/namespace/class1/instance1?MiqServer%3A%3Amiq_server=1&ServiceTemplate%3A%3Aservice_template=1&User%3A%3Auser=1&dialog_enviroment=0&object_name=instance1&vmdb_object_type=service_template]
[----] I, [2018-04-17T01:51:07.452090 #12136:160b818]  INFO -- : Updated namespace [/namespace/class1/instance1?MiqServer%3A%3Amiq_server=1&ServiceTemplate%3A%3Aservice_template=1&User%3A%3Auser=1&dialog_enviroment=0&object_name=instance1&vmdb_object_type=service_template  dialog/namespace]


As you mentioned previous comment, also noticed there is another 'dialog_enviroment=10' call after this, . Logs attached. Thx!

Comment 10 Greg McCullough 2018-05-23 18:16:47 UTC
Working with QE to validate changes from bug 1559757.

Comment 11 Tina Fitzgerald 2018-05-25 13:01:19 UTC
We think issue has been fixed with latest PRs. Waiting for QE to validate.

Comment 15 Tina Fitzgerald 2018-06-04 15:23:33 UTC
We believe this issue has already been addressed and are waiting to QE to validate against master.

Comment 16 Shveta 2018-06-04 18:47:53 UTC
Value choosen in dropdown is passed correctly to dialog_environment .
Checked on master.20180531005435_f827149
Appliance : https://10.8.199.197.

This verification is only for value passed down to dialog_environment variable.

Logs 
==============================
tail -f /var/www/miq/vmdb/log/automation.log |grep 'dialog_enviroment'
[----] I, [2018-06-04T14:40:59.783842 #11940:4527d7c]  INFO -- : Instantiating [/System/Request/InspectMe?MiqServer%3A%3Amiq_server=1&ServiceTemplate%3A%3Aservice_template=2&User%3A%3Auser=1&dialog_enviroment=0&object_name=InspectMe&vmdb_object_type=service_template]
[----] I, [2018-06-04T14:40:59.811872 #11940:4527d7c]  INFO -- : Updated namespace [/System/Request/InspectMe?MiqServer%3A%3Amiq_server=1&ServiceTemplate%3A%3Aservice_template=2&User%3A%3Auser=1&dialog_enviroment=0&object_name=InspectMe&vmdb_object_type=service_template  new_domain/System]





[----] I, [2018-06-04T14:42:29.768926 #11940:452417c]  INFO -- : Instantiating [/System/Request/InspectMe?MiqServer%3A%3Amiq_server=1&ServiceTemplate%3A%3Aservice_template=2&User%3A%3Auser=1&dialog_enviroment=0&object_name=InspectMe&vmdb_object_type=service_template]
[----] I, [2018-06-04T14:42:29.796252 #11940:452417c]  INFO -- : Updated namespace [/System/Request/InspectMe?MiqServer%3A%3Amiq_server=1&ServiceTemplate%3A%3Aservice_template=2&User%3A%3Auser=1&dialog_enviroment=0&object_name=InspectMe&vmdb_object_type=service_template  new_domain/System]


[----] I, [2018-06-04T14:43:00.729629 #11851:f01130]  INFO -- : Q-task_id([r1_service_template_provision_task_1]) Instantiating [/Service/Provisioning/StateMachines/ServiceProvision_Template/CatalogItemInitialization?MiqServer%3A%3Amiq_server=1&Service%3A%3AService=1&ServiceTemplateProvisionTask%3A%3Aservice_template_provision_task=1&User%3A%3Auser=1&dialog_enviroment=10&object_name=CatalogItemInitialization&request=clone_to_service&service_action=Provision&vmdb_object_type=service_template_provision_task]
[----] I, [2018-06-04T14:43:01.268765 #11851:f01130]  INFO -- : Q-task_id([r1_service_template_provision_task_1]) Updated namespace [/Service/Provisioning/StateMachines/ServiceProvision_Template/CatalogItemInitialization?MiqServer%3A%3Amiq_server=1&Service%3A%3AService=1&ServiceTemplateProvisionTask%3A%3Aservice_template_provision_task=1&User%3A%3Auser=1&dialog_enviroment=10&object_name=CatalogItemInitialization&request=clone_to_service&service_action=Provision&vmdb_object_type=service_template_provision_task  ManageIQ/Service/Provisioning/StateMachines]
[----] I, [2018-06-04T14:43:04.845935 #11851:11c3864]  INFO -- : <AEMethod groupsequencecheck> 	dialog_enviroment: 10
[----] I, [2018-06-04T14:43:08.832446 #11851:f03804]  INFO -- : <AEMethod dialog_parser> dialog_options: {"dialog_enviroment"=>10, "request"=>"clone_to_service", :service_action=>"Provision", "Service::Service"=>1}
[----] I, [2018-06-04T14:43:08.835023 #11851:f03804]  INFO -- : <AEMethod dialog_parser> Adding seq_id: 0 key: dialog_enviroment value: 10 
[----] I, [2018-06-04T14:43:08.915222 #11851:f03804]  INFO -- : <AEMethod dialog_parser> parsed_dialog_options: "---\n0:\n  :enviroment: 10\n  :dialog_enviroment: 10\n"
[----] I, [2018-06-04T14:43:12.317367 #11851:f03674]  INFO -- : <AEMethod catalogiteminitialization> merged_options_hash: {:enviroment=>10, :dialog_enviroment=>10}
[----] I, [2018-06-04T14:43:12.438411 #11851:f03674]  INFO -- : <AEMethod catalogiteminitialization> Adding Option: {dialog_enviroment => 10} to Destination id: 1
[----] I, [2018-06-04T14:43:23.674275 #11851:12149a8]  INFO -- : <AEMethod provision> 	dialog_enviroment: 10
[----] I, [2018-06-04T14:43:26.691455 #11851:1232c78]  INFO -- : <AEMethod check_provisioned> 	dialog_enviroment: 10
[----] I, [2018-06-04T14:44:32.349583 #11859:f01130]  INFO -- : Q-task_id([r1_service_template_provision_task_1]) Instantiating [/Service/Provisioning/StateMachines/ServiceProvision_Template/CatalogItemInitialization?MiqServer%3A%3Amiq_server=1&Service%3A%3AService=1&ServiceTemplateProvisionTask%3A%3Aservice_template_provision_task=1&User%3A%3Auser=1&ae_state=checkprovisioned&ae_state_previous=---%0A%22%2FManageIQ%2FService%2FProvisioning%2FStateMachines%2FServiceProvision_Template%2FCatalogItemInitialization%22%3A%0A%20%20ae_state%3A%20checkprovisioned%0A%20%20ae_state_retries%3A%201%0A%20%20ae_state_started%3A%202018-06-04%2018%3A43%3A25%20UTC%0A%20%20ae_state_max_retries%3A%20100%0A&ae_state_retries=1&ae_state_started=2018-06-04%2018%3A43%3A25%20UTC&dialog_enviroment=10&object_name=CatalogItemInitialization&request=clone_to_service&service_action=Provision&vmdb_object_type=service_template_provision_task]
[----] I, [2018-06-04T14:44:32.964148 #11859:f01130]  INFO -- : Q-task_id([r1_service_template_provision_task_1]) Updated namespace [/Service/Provisioning/StateMachines/ServiceProvision_Template/CatalogItemInitialization?MiqServer%3A%3Amiq_server=1&Service%3A%3AService=1&ServiceTemplateProvisionTask%3A%3Aservice_template_provision_task=1&User%3A%3Auser=1&ae_state=checkprovisioned&ae_state_previous=---%0A%22%2FManageIQ%2FService%2FProvisioning%2FStateMachines%2FServiceProvision_Template%2FCatalogItemInitialization%22%3A%0A%20%20ae_state%3A%20checkprovisioned%0A%20%20ae_state_retries%3A%201%0A%20%20ae_state_started%3A%202018-06-04%2018%3A43%3A25%20UTC%0A%20%20ae_state_max_retries%3A%20100%0A&ae_state_retries=1&ae_state_started=2018-06-04%2018%3A43%3A25%20UTC&dialog_enviroment=10&object_name=CatalogItemInitialization&request=clone_to_service&service_action=Provision&vmdb_object_type=service_template_provision_task  ManageIQ/Service/Provisioning/StateMachines]
[----] I, [2018-06-04T14:44:34.862968 #11859:13c3c90]  INFO -- : <AEMethod check_provisioned> 	dialog_enviroment: 10

Comment 19 errata-xmlrpc 2018-07-12 13:14:16 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/RHSA-2018:2184