Bug 1785624

Summary: [UI] Importing templates with associate 'never' is not resulting as expected
Product: Red Hat Satellite Reporter: Jitendra Yejare <jyejare>
Component: Templates PluginAssignee: Ondřej Pražák <oprazak>
Status: CLOSED ERRATA QA Contact: Jitendra Yejare <jyejare>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.7.0CC: bbuckingham, mhulan, oprazak
Target Milestone: 6.8.0Keywords: Triaged
Target Release: Unused   
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: 2020-10-27 12:59:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1778146    

Description Jitendra Yejare 2019-12-20 13:35:24 UTC
Description of problem:
1. Importing Provisioning Template from UI with associate "never" throws an error "the template id can't be blank".
2. The other kind of templates is being associated with the taxos which they are being imported and it shouldn't be.
3. If imported from any taxo, then all the taxos are being assigned to imported templates.

Version-Release number of selected component (if applicable):
Satellite 6.7 snap 6

How reproducible:
Always

Steps to Reproduce:
1. Keep(in local dir/git) the templates to be imported in a satellite that has multiple orgs and locs in their metadata. Make sure all the taxonomies in metadata are available in the satellite.
2. Attempt to import those templates and set associate as 'never'. Import in org and loc by switching the taxonomies context in satellite. 
3. Observe the taxonomies associated with imported templates.

Actual results:
1. Importing Provisioning Template from UI with associate "never" throws an error "the template id can't be blank".
2. The other kind of templates is being associated with the taxos which they are being imported and it shouldn't be as we have set associate to 'new'.
3. If imported from any taxo, then all the taxos are being assigned to imported templates.

Expected results:
1. Importing Provisioning Template from UI with associate "never" should be a success and shouldn't throw any error.
2. Any kind of templates shouldn't be associated with the taxos.


Additional info:

Comment 3 Ondřej Pražák 2020-01-03 11:07:20 UTC
I see 2 issues reported in this BZ:

1. Importing Provisioning Template from UI with "associate: never" gives "templateKindId: can't be blank" error even though template kind is specified in metadata

- Valid bug, template kind should be assigned and template should save without errors.

2. Templates are associated with taxonomies from metadata when "associate: new" is used and all taxonomies in metadata already exist.

- As far as I can tell, this works as intended. The "new" refers to the template, not the taxonomies. It means: if the template is newly created, add associations from metadata. BZ1785547 tracks importing from taxonomy context.


Cloning upstream to fix 1.

Comment 4 Ondřej Pražák 2020-01-03 11:09:03 UTC
Created redmine issue https://projects.theforeman.org/issues/28629 from this bug

Comment 5 Bryan Kearney 2020-01-20 15:01:01 UTC
Upstream bug assigned to oprazak

Comment 6 Bryan Kearney 2020-01-20 15:01:04 UTC
Upstream bug assigned to oprazak

Comment 7 Bryan Kearney 2020-02-28 13:00:44 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/28629 has been resolved.

Comment 8 Jitendra Yejare 2020-03-13 09:00:57 UTC
@BK/@Brad,

Is there any chance to get this in 6.7 snap 16 now. The flag was missing and I added the same 2nd Mar, but still its not pulled for 6.7 snaps.

Comment 14 Jitendra Yejare 2020-07-02 16:50:26 UTC
Verified!

Steps:
---------------
1. Attempt to import the Provisioning templates from UI, where the templates have correct metadata for their template kind.


Behavior:
--------------
1. The provisioning templates are imported successfully and showing the correct template kind.
2. The issue described in `Description` of but that throws `kind can't be blank` is no more observed.

Comment 17 errata-xmlrpc 2020-10-27 12:59:52 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 (Important: Satellite 6.8 release), 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:4366