Bug 1328976

Summary: hammer template info doesn't show whether the template is locked
Product: Red Hat Satellite Reporter: Elyézer Rezende <erezende>
Component: HammerAssignee: Marek Hulan <mhulan>
Status: CLOSED ERRATA QA Contact: Katello QA List <katello-qa-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.2.0CC: bbuckingham, bkearney, ehelms, inecas, kshirsal, mmccune, stbenjam, stkachen
Target Milestone: UnspecifiedKeywords: Regression, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rubygem-hammer_cli_foreman-0.5.1.7-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-27 11:05:17 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 Elyézer Rezende 2016-04-20 19:19:22 UTC
Description of problem:
Previously (Satellite 6.1) hammer template create raised an issue every time a locked template was created, but now it is accepting. That said it seems to be a regression, if not then the info output should present if that template is locked or not.

Version-Release number of selected component (if applicable):
satellite-6.2.0-8.2.beta.el7sat.noarch

How reproducible:
Always

Steps to Reproduce:
1. Run: hammer template create --name="<name>" --file="<path to file>" --type="user_data" --locked="true"

Actual results:
The locked template is created

Expected results:
If locked template creation is allowed then the hammer template info should print out the information. If the behavior is expected to be the same, not being able to create a locked template, then the create command should fail and inform the user or even better the locked option should not even be listed as valid options.

Additional info:

$ LANG=en_US.UTF-8  hammer -v -u admin -p changeme --output=csv template create --name="BhCgsYHMDB" --file="/tmp/iiu3RZiWH1" --type="user_data" --locked="true"
Message,Id,Name
Config template created,198,BhCgsYHMDB

$ LANG=en_US.UTF-8  hammer -v -u admin -p changeme  template info --id="198"
Id:                198
Name:              BhCgsYHMDB
Type:              user_data
Operating systems:

Comment 5 Stephen Benjamin 2016-04-21 16:12:05 UTC
Definitely not a regression, this is a bug fix. Previously you could not create locked templates in one step, but that was fixed in http://projects.theforeman.org/issues/11619.

But we're not showing that information in info, so that's a bug for sure.

Comment 6 Stephen Benjamin 2016-05-11 18:12:24 UTC
*** Bug 1333753 has been marked as a duplicate of this bug. ***

Comment 8 Bryan Kearney 2016-05-23 19:21:55 UTC
verified
version tested: satellite-6.2.0-12.1.el7sat.noarch
Steps to verify:

[vagrant@sat-test-rhel7 ~]$ hammer -u admin -p changeme template create --name "bk_test" --file "/home/vagrant/bk" --type="user_data" --locked="true"
Config template created
[vagrant@sat-test-rhel7 ~]$ hammer -u admin -p changeme template info --id 98
Id:                98
Name:              bk_test
Type:              user_data
Locked:            yes
Operating systems:

Comment 9 Bryan Kearney 2016-07-27 11:05:17 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/RHBA-2016:1501