Bug 1343546 - Bootstrap script should run commands with --force
Summary: Bootstrap script should run commands with --force
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Bootstrap
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: Unspecified
Assignee: Rich Jerrido
QA Contact: Lukas Pramuk
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-06-07 12:43 UTC by Lukas Pramuk
Modified: 2019-09-26 14:48 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-06-07 15:27:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Lukas Pramuk 2016-06-07 12:43:42 UTC
Description of problem:
Bootstrap script should run commands with --force to successfully handle situation when you re-run script or you have already registerred host

Version-Release number of selected component (if applicable):
@Sat6.2.0-Snap14
katello-client-bootstrap-1.1.0-1.el7sat.noarch

How reproducible:
always

Steps to Reproduce:
1a. Have a host regged to CDN
2a. Run ./bootstrap.py and watch it fail with "subscription-manager register..."
[ERROR], [2016-06-07 06:28:08], EXITING: [/usr/sbin/subscription-manager register --org 'Default_Organization' --name '<CLIENT_FQDN>' --activationkey 'My Activation Key'  --serverurl=https://<SAT_FQDN>:443/rhsm --baseurl=https://<SAT_FQDN>/pulp/repos] failed to execute properly.
This system is already registered. Use --force to override

1b. Have a host that ha bootstrap ca certs installed
2b. Run ./bootstrap.py and watch it fail with "rpm -Uvh <bootstrap-ca-certs>..."
[ERROR], [2016-06-06 08:49:13], EXITING: [rpm -Uvh http://<SAT_FQDN>/pub/katello-ca-consumer-latest.noarch.rpm] failed to execute properly.
Retrieving http://<SAT_FQDN>/pub/katello-ca-consumer-latest.noarch.rpm
Preparing...                ##################################################
	package katello-ca-consumer-<SAT_FQDN>-1.0-1.noarch is already installed

Actual results:
failure 

Expected results:
success

Additional info:
rpm -Uvh --force http://<SAT_FQDN>/pub/katello-ca-consumer-latest.noarch.rpm would handle situation when rpm is already installed, RC=0

Comment 2 Evgeni Golov 2016-06-07 14:55:32 UTC
Why aren't you passing --force to the bootstrap script?
That should clean up all existing subs and rpms.

Comment 3 Lukas Pramuk 2016-06-07 15:27:19 UTC
Ooops, I had to miss it.


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