Bug 1754424 - Updating policy to Ansible without ansible role should not break page
Summary: Updating policy to Ansible without ansible role should not break page
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: SCAP Plugin
Version: 6.6.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: 6.7.0
Assignee: Ondřej Pražák
QA Contact: Sanket Jagtap
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-09-23 08:28 UTC by Sanket Jagtap
Modified: 2020-04-14 13:25 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-04-14 13:25:37 UTC
Target Upstream Version:


Attachments (Terms of Use)
Validation page break (133.36 KB, image/png)
2019-09-24 10:04 UTC, Sanket Jagtap
no flags Details


Links
System ID Priority Status Summary Last Updated
Foreman Issue Tracker 27936 Normal Closed Updating policy to Ansible without ansible role should not break page 2020-06-18 17:37:51 UTC
Red Hat Product Errata RHSA-2020:1454 None None None 2020-04-14 13:25:49 UTC

Description Sanket Jagtap 2019-09-23 08:28:06 UTC
Description of problem:


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

How reproducible:
Always

Steps to Reproduce:
1. Scap Ansible role is not imported into satellite
2. Try to update existing puppet policy


Actual results:
ActiveRecord::AssociationTypeMismatch
AnsibleRole(#66352280) expected, got nil which is an instance of NilClass(#9657900)
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/associations/association.rb:238:in `raise_on_type_mismatch!'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/associations/has_many_through_association.rb:17:in `block in concat'

Expected results:
Unable to save
Required Ansible role theforeman.foreman_scap_client was not found, please ensure it is imported first


Additional info:

Comment 2 Marek Hulan 2019-09-23 08:30:51 UTC
How did you update the policy? UI or API? I think it should be forbidden to change the policy deployment mode. Or was that a regular update of the policy (e.g. name)?

Comment 3 Sanket Jagtap 2019-09-24 10:04:25 UTC
The ansible role is not imported to satellite

I have a puppet Policy already in satellite. 

IF we want to create a new ansible policy, I get a validation error , to import the Ansible role. This is correct and Valid

But, If I want update the existing puppet role with ansible, I should get the same validation error, but instead on submit it breaks the page. 

Update is done through UI

This issue is to track the validation error on update with there is no ansible role.
PFA,

Comment 4 Sanket Jagtap 2019-09-24 10:04:48 UTC
Created attachment 1618560 [details]
Validation page break

Comment 5 Marek Hulan 2019-09-25 11:37:02 UTC
Created redmine issue https://projects.theforeman.org/issues/27936 from this bug

Comment 6 Bryan Kearney 2019-10-01 10:06:39 UTC
Upstream bug assigned to oprazak@redhat.com

Comment 7 Bryan Kearney 2019-10-01 10:06:41 UTC
Upstream bug assigned to oprazak@redhat.com

Comment 8 Bryan Kearney 2019-10-24 14:06:43 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/27936 has been resolved.

Comment 9 Sanket Jagtap 2019-12-31 11:42:42 UTC
Build: Satellite 6.7 snap7 

Page doesn't break now and display a Validation error for user

Unable to save
Required Ansible role theforeman.foreman_scap_client was not found, please ensure it is imported first.

Comment 12 errata-xmlrpc 2020-04-14 13:25:37 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-2020:1454


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