Bug 1462588

Summary: When updating a snippet with hammer and --type parameter is missing the error message says Template kind can't be blank
Product: Red Hat Satellite Reporter: Mark Barry <mwbarry>
Component: Provisioning TemplatesAssignee: Tomas Strachota <tstrachota>
Status: CLOSED ERRATA QA Contact: Nikhil Kathole <nkathole>
Severity: low Docs Contact:
Priority: unspecified    
Version: UnspecifiedCC: bbuckingham, bkearney, dhlavacd, jcallaha, nkathole, tstrachota
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: hammer-cli-foreman 0.11 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 16:54:37 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 Mark Barry 2017-06-19 01:53:02 UTC
Description of problem:
Incorrect parameter name (kind) listed for `hammer template update` command when type parameter is missing.

Version-Release number of selected component (if applicable):
hammer --version
hammer (0.10.0)
 * hammer_cli_foreman (0.10.0)
 * hammer_cli_foreman_bootdisk (0.1.3)
 * hammer_cli_foreman_docker (unknown version)
 * hammer_cli_foreman_tasks (unknown version)
 * hammer_cli_import (0.11.3)
 * hammer_cli_katello (0.10.0)


How reproducible:
100%

Steps to Reproduce:
1. hammer -p password template update --name "pxelinux_discovery" --locked false

Actual results:
Could not update the provisioning template:
  Template kind can't be blank


Expected results:
Could not update the provisioning template:
  Template type can't be blank


Additional info:
On the /templates/provisioning_templates (Provisioning Templates) web page, the headings include Kind and Snippet, which represents the Type parameter.
To me, it would make sense to also update the web interface to have Type as the header, so that the two interfaces are consistent.

Comment 2 Tomas Strachota 2017-06-28 14:04:10 UTC
This happens only when updating snippets. The message is incorrect but the main issue here is that the kind parameter shouldn't be required at all.

I updated the title accordingly.

Comment 3 Satellite Program 2017-06-29 10:01:50 UTC
Upstream bug assigned to tstrachota

Comment 4 Satellite Program 2017-06-29 10:01:54 UTC
Upstream bug assigned to tstrachota

Comment 5 Satellite Program 2017-06-30 16:01:46 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/20145 has been resolved.

Comment 6 Nikhil Kathole 2017-09-24 09:53:48 UTC
VERIFIED

Version Tested:
Satellite-6.3 Snap 17

steps:

# hammer template create --name test --type snippet --file test.erb 
Provisioning template created
# hammer template update --name test --locked true
Provisioning template updated
# hammer template update --name test --locked false
Provisioning template updated
# hammer template update --name "pxelinux_discovery" --locked false
Provisioning template updated

Successfully updated template when kind parameter in UI is missing.

Comment 7 Satellite Program 2018-02-21 16:54: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-2018:0336