Bug 1886876 - hammer org remove-provisioning-template command returns error
Summary: hammer org remove-provisioning-template command returns error
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Provisioning Templates
Version: 6.8.0
Hardware: Unspecified
OS: Unspecified
high
medium vote
Target Milestone: 6.9.0
Assignee: Oleh Fedorenko
QA Contact: Roman Plevka
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-10-09 15:14 UTC by Tasos Papaioannou
Modified: 2021-04-21 13:18 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-04-21 13:18:20 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 30938 0 Normal Closed Use parent resource instead of hardcoded one 2020-12-01 12:39:02 UTC
Red Hat Product Errata RHSA-2021:1313 0 None None None 2021-04-21 13:18:38 UTC

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


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