Bug 798918 - Headpin cli unregister doesn't have environment option
Headpin cli unregister doesn't have environment option
Status: CLOSED CURRENTRELEASE
Product: Subscription Asset Manager
Classification: Red Hat
Component: katello (Show other bugs)
1.0.0
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Petr Chalupa
Tazim Kolhar
: Triaged
Depends On:
Blocks: sam11-tracker
  Show dependency treegraph
 
Reported: 2012-03-01 04:22 EST by yu zheng
Modified: 2016-04-25 20:54 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-08-22 09:23:49 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description yu zheng 2012-03-01 04:22:29 EST
Description of problem:
Register two systems with a same name to two environments of an org respectively. These system can't be unregistered by headpin cli. 

Version-Release number of selected component (if applicable):
katello-cli-common-0.1.100-2.el6.noarch
katello-cli-headpin-0.1.15-2.el6.noarch
katello-headpin-0.1.140-3.el6.noarch
katello-headpin-all-0.1.140-3.el6.noarch

How reproducible:
always

Steps to Reproduce:
1.Register system1 to env1.
# subscription-manager register --org=ACME_Corporation --environment=env1 --name=testsystem
2.Register system2 to env2.
# subscription-manager register --org=ACME_Corporation --environment=env2 --name=testsystem
3.Check registered systems.
# headpin -u admin -p admin system list --org=ACME_Corporation
----------------------------------------------------------
      Systems List For Org [ ACME_Corporation ]
 Name        
----------------------------------------------------------
 testsystem  
 testsystem 
3.Unregister system1 from SAM by using headpin cli.
# headpin -u admin -p admin system unregister --help
Usage: headpin [options]
Options:
  -h, --help    show this help message and exit
  -g            grep friendly output
  -v            verbose, more structured output
  -d DELIMITER  grep friendly output column delimiter
  --org=ORG     organization name (required)
  --name=NAME   system name (required)
  
Actual results:
There is no environment option.

Expected results:
Environment should be specified to decide which system will be unregistered.

Additional info:
# headpin -u admin -p admin system unregister --name=testsystem --org=ACME_Corporation
Could not find System [ testsystem ] in Org [ ACME_Corporation ]
Comment 1 Petr Chalupa 2012-04-16 12:43:21 EDT
fixed in 9575569ba3736103cd8fdb5e1ef588c0cbba45af
Comment 2 Tazim Kolhar 2012-04-30 03:55:57 EDT
VERIFIED with the build :
[root@tyan-gt24-12 ~]# rpm -qa | grep katello
katello-configure-0.3.1-2.el6_2.noarch
katello-selinux-0.1.10-1.el6.noarch
katello-cli-headpin-0.2.0-1.el6_2.noarch
katello-candlepin-cert-key-pair-1.0-1.noarch
katello-configure-upgrade-0.3.1-2.el6_2.noarch
katello-cli-common-0.3.1-1.el6_2.noarch
katello-glue-candlepin-0.3.0-2.el6_2.noarch
katello-certs-tools-1.0.6-1.el6.noarch
katello-headpin-0.2.4-3.el6_2.noarch
katello-common-0.3.0-2.el6_2.noarch
katello-headpin-all-0.2.4-3.el6_2.noarch


Actual Results produced :

[root@kvm-guest-04 ~]# rpm -ivh http://tyan-gt24-12.rhts.eng.bos.redhat.com/pub/candlepin-cert-consumer-tyan-gt24-12.rhts.eng.bos.redhat.com-1.0-1.noarch.rpm
Retrieving http://tyan-gt24-12.rhts.eng.bos.redhat.com/pub/candlepin-cert-consumer-tyan-gt24-12.rhts.eng.bos.redhat.com-1.0-1.noarch.rpm
Preparing...                ########################################### [100%]
   1:candlepin-cert-consumer########################################### [100%]


[root@kvm-guest-04 ~]#  subscription-manager register --user admin --password admin --org ACME_Corporation --environment DEV --autosubscribe
The system has been registered with id: 5b546043-5a0d-46e0-a135-84b5783186e2 
Installed Product Current Status:

ProductName:         	Red Hat Enterprise Linux Server
Status:               	Subscribed  


[root@tyan-gt24-12 ~]# headpin -u admin -p admin system list --org ACME_Corporation
--------------------------------------------------------------------------------
                  Systems List For Org [ ACME_Corporation ]

 Name                                   Ipv4 Address   Service Level  
--------------------------------------------------------------------------------
 kvm-guest-04.rhts.eng.bos.redhat.com   None  
                        
[root@tyan-gt24-12 ~]# headpin -u admin -p admin system unregister --help
Usage: headpin [options]

Options:
  -h, --help            show this help message and exit
  -g                    grep friendly output
  -v                    verbose, more structured output
  -d DELIMITER          column delimiter in grep friendly output, works only
                        with option -g
  --org=ORG             organization name (required)
  --name=NAME           system name (required)
  --environment=ENVIRONMENT
                        environment name eg: development


Appropriate option provided to unregister the system is provided

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