Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1526871

Summary: Satellite 6.3.0 Beta - TemplateSync plug-in import is replacing lock templates even setting for "Force import = no"
Product: Red Hat Satellite Reporter: vijsingh
Component: Templates PluginAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED NOTABUG QA Contact: Katello QA List <katello-qa-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.3.0CC: mhulan, oprazak, vijsingh
Target Milestone: Unspecified   
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: 2017-12-18 10:23:11 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:

Description vijsingh 2017-12-18 05:05:43 UTC
Description of problem:

 TemplateSync plug-in import is replacing lock templates even setting for "Force import = no"

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

Satellite 6.3.0 Beta
tfm-rubygem-foreman_templates-5.0.1-1.fm1_15.el7sat.noarch

How reproducible:


Steps to Reproduce:
1. Keep "Force import = no" under Administer→Settings→Templates
2. make changes under any exported template ( which in lock state at Satellite):
  
 e.g. XenServer default finish
 
3. run below to import:

 # foreman-rake templates:import


Actual results:

~~~~
@@ -1,8 +1,9 @@
 <%#
-kind: finish
 name: XenServer default finish
-oses:
-- XenServer
--%>
+snippet: false
+model: ProvisioningTemplate
+kind: finish
+%>
 #!/bin/bash
 /usr/bin/wget --output-document=/dev/null <%= foreman_url('built') %>
+######### This is test #####                 <=== This is change 

XenServer default finish - import success
Parsing: /provisioning_templates/PXELinux/xenserver_default_pxelinux.erb
  Updating Template id 50:XenServer default PXELinux
--- /tmp/diffy20171218-10743-1orir5y	2017-12-18 07:47:29.891607520 -0500
+++ /tmp/diffy20171218-10743-18155z9	2017-12-18 07:47:29.891607520 -0500

~~~~

Expected results:

If setting is "Force import = no" then lock template should not be replace.

Additional info:

Comment 2 Marek Hulan 2017-12-18 08:14:55 UTC
Thanks, I've created a new component for it. Please prefer using API, rake tasks are not recommended as they bypass proper authentication and authorization. Is it reproducible using API?

Comment 4 vijsingh 2017-12-18 10:23:11 UTC
Thanks , Issue is not reproducible with API:

"Parsing: /provisioning_templates/provision/xenserver_default_answerfile.erb","Skipping Template id 48:XenServer default answerfile - template is locked","XenServer default answerfile - import failure","Parsing: /partition_tables_templates/xenserver_default.erb","  No change to Ptable id 94:XenServer default","XenServer default - import success","Parsing: /partition_tables_templates/mylocalxenserver_default.erb","  No change to Ptable id 132:MyLocalXenServer default","MyLocalXenServer default - import success"]}


This Bug can close.