Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1396662 - bootstrap.py --remove fails to execute with error "global name 'put_json' is not defined"
Summary: bootstrap.py --remove fails to execute with error "global name 'put_json' is ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Bootstrap
Version: 6.2.4
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: Unspecified
Assignee: Rich Jerrido
QA Contact: Sanket Jagtap
URL:
Whiteboard:
Depends On:
Blocks: 1405490
TreeView+ depends on / blocked
 
Reported: 2016-11-18 21:48 UTC by Marcelo Giles
Modified: 2019-09-26 17:30 UTC (History)
6 users (show)

Fixed In Version: katello-client-bootstrap-1.2.2-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1405490 (view as bug list)
Environment:
Last Closed: 2017-01-26 10:45:53 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github Katello katello-client-bootstrap pull 80 0 None None None 2016-11-30 10:21:21 UTC
Red Hat Product Errata RHBA-2017:0197 0 normal SHIPPED_LIVE Satellite 6.2.7 Async Bug Release 2017-01-26 15:38:38 UTC

Description Marcelo Giles 2016-11-18 21:48:50 UTC
Description of problem:
When running the bootstrap.py with the --remove option to delete and unsubscribe a host from satellite, I get:

Traceback (most recent call last):
  File "/root/bootstrap.py", line 507, in <module>
    disassociate_host(host_id)
  File "/root/bootstrap.py", line 420, in disassociate_host
    put_json(myurl)
NameError: global name 'put_json' is not defined

I edited the script and commented line 420:

def disassociate_host(host_id):
    myurl = "https://" + options.foreman_fqdn + ":" + API_PORT + "/api/v2/hosts/" + str(host_id) + "/disassociate"
    print_running("Disassociating host id %s for host %s" % (host_id, FQDN))
#    put_json(myurl)

The script now works as expected and removes the host from Satellite. 

Version-Release number of selected component (if applicable):
katello-client-bootstrap-1.1.0-2.el7sat.noarch

How reproducible:
Always

Comment 2 Evgeni Golov 2016-11-30 10:21:22 UTC
This is fixed upstream in https://github.com/Katello/katello-client-bootstrap/pull/80

Should be in bootstrap 1.2.0, please verify

Comment 3 Rich Jerrido 2016-11-30 12:09:03 UTC
(In reply to Evgeni Golov from comment #2)
> This is fixed upstream in
> https://github.com/Katello/katello-client-bootstrap/pull/80
> 
> Should be in bootstrap 1.2.0, please verify

Moving to POST as upstream fix is available.

Comment 4 Sanket Jagtap 2017-01-10 15:03:53 UTC
Build: Satellite 6.2.7 snap 1

./bootstrap.py -l admin -s abc.com -o 'Default Organization' -L 'Default Location' -v --remove

Foreman Bootstrap Script
This script is designed to register new systems or to migrate an existing system to a Foreman server with Katello
admin's password:

[NOTIFICATION], [2017-01-10 14:58:58], [Unregistering]
[RUNNING], [2017-01-10 14:58:58], [/usr/sbin/subscription-manager unregister]
....
.....
Complete!
[SUCCESS], [2017-01-10 14:59:08], [/usr/bin/yum -y erase puppet], completed successfully.

[SUCCESS], [2017-01-10 14:59:08], [Removing /var/lib/puppet/], completed successfully.

Comment 6 errata-xmlrpc 2017-01-26 10:45:53 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-2017:0197


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