Bug 1526871 - Satellite 6.3.0 Beta - TemplateSync plug-in import is replacing lock templates even setting for "Force import = no"
Summary: Satellite 6.3.0 Beta - TemplateSync plug-in import is replacing lock template...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Templates Plugin
Version: 6.3.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-12-18 05:05 UTC by vijsingh
Modified: 2017-12-18 10:23 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-12-18 10:23:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

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.


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