Bug 1886876

Summary: hammer org remove-provisioning-template command returns error
Product: Red Hat Satellite Reporter: Tasos Papaioannou <tpapaioa>
Component: Provisioning TemplatesAssignee: Oleh Fedorenko <ofedoren>
Status: CLOSED ERRATA QA Contact: Roman Plevka <rplevka>
Severity: medium Docs Contact:
Priority: high    
Version: 6.8.0CC: mhulan
Target Milestone: 6.9.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: 2021-04-21 13:18:20 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 Tasos Papaioannou 2020-10-09 15:14:42 UTC
Description of problem:

The same issue described and fixed in:

Bug 1845860 - hammer org add-provisioning-template command returns Error: undefined method `[]' for nil:NilClass
https://bugzilla.redhat.com/show_bug.cgi?id=1845860

also exists for the remove-provisioning-template command:

# hammer org remove-provisioning-template --id 1
Could not disassociate the provisioning templates:
  Error: undefined method `[]' for nil:NilClass

The upstream fix exists and needs to be included in 6.8.0 as well.

https://projects.theforeman.org/issues/30938

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

tfm-rubygem-hammer_cli_foreman-2.1.2.1-1.el7sat.noarch

How reproducible:

100%

Steps to Reproduce:
1.) Add a provisioning template:

# hammer org add-provisioning-template --id 1 --provisioning-template-id 181
The provisioning templates were associated.

2.) Try to remove it:

# hammer org remove-provisioning-template --id 1 --provisioning-template-id 181
Could not disassociate the provisioning templates:
  Error: undefined method `[]' for nil:NilClass


Actual results:

Error when trying to remove provisioning template.

Expected results:

No error, successful removal of provisioning template.

Additional info:

Comment 1 Oleh Fedorenko 2020-10-20 09:23:41 UTC
Connecting redmine issue https://projects.theforeman.org/issues/30938 from this bug

Comment 2 Brad Buckingham 2020-11-13 19:54:55 UTC
Fix is in Satellite 6.9 SNAP 1 with tfm-rubygem-hammer_cli_foreman-2.3.0-1.el7sat.noarch

Comment 3 Roman Plevka 2021-03-22 16:13:45 UTC
VERIFIED
on sat6.9.0-18.0

```
# hammer org info --name org2 | grep kkKiFeCBLerobottelo
#
# hammer org add-provisioning-template --id 250 --provisioning-template-id 204
The provisioning templates were associated.

# hammer org info --name org2 | grep kkKiFeCBLerobottelo
    kkKiFeCBLerobottelo ansible_provisioning_callback

# hammer org remove-provisioning-template --id 250 --provisioning-template-id 204
The provisioning templates were disassociated.
# hammer org info --name org2 | grep kkKiFeCBLerobottelo
#

```

Comment 6 errata-xmlrpc 2021-04-21 13:18:20 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 (Moderate: Satellite 6.9 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-2021:1313