Hide Forgot
Description of problem: I registered a system from katello cli and tried to re-register the same system with same name and it was successful. checking info of already registered system: ============================================ [root@dhcp201-167 ~]# katello -u admin -p admin system info --org=ACME_Corporation --name=dhcp201-136.englab.pnq.redhat.com -------------------------------------------------------------------------------- System Information For Org [ ACME_Corporation ] -------------------------------------------------------------------------------- Name: dhcp201-136.englab.pnq.redhat.com Uuid: b7bbc425-134f-4754-a7f5-d605baf44353 Location: None Registered: 2011/08/25 15:03:25 Last updated: 2011/08/25 15:03:25 Description: Initial Registration Params [root@dhcp201-167 ~]# katello -u admin -p admin system register --name=dhcp201-136.englab.pnq.redhat.com --org=ACME_Corporation --environment=production Successfully registered system [ dhcp201-136.englab.pnq.redhat.com ] [root@dhcp201-167 ~]# katello -u admin -p admin system register --name=dhcp201-136.englab.pnq.redhat.com --org=ACME_Corporation --environment=production Successfully registered system [ dhcp201-136.englab.pnq.redhat.com ] Repetitive listing of same system: ================================== [root@dhcp201-167 ~]# katello -u admin -p admin system list --org=ACME_Corporation ------------------------------------------------------------------------------- Systems List For Org [ ACME_Corporation ] Name ------------------------------------------------------------------------------- dhcp201-167.englab.pnq.redhat.com dhcp201-136.englab.pnq.redhat.com dhcp201-136.englab.pnq.redhat.com dhcp201-136.englab.pnq.redhat.com [root@dhcp201-167 ~]# Version-Release number of selected component (if applicable): [root@dhcp201-167 ~]# rpm -qa | grep katello katello-cli-0.1.5-1.git.15.654a7df.fc15.noarch katello-0.1.70-1.git.7.ca8d03c.fc15.noarch [root@dhcp201-167 ~]# How reproducible: always Steps to Reproduce: 1. register a system 2. re-register the same system Actual results: I can register a system multiple times and with same name. Expected results: Re-registering an already registered system shouldn't be allowed. A message should be thrown like: The specified system <name> is already registered. Additional info:
Validation added in commit b2ba6a8838edf7ccffb5cca1fdb69ace3489a376. Note: The registration of the system using different name still works. Question for bkearney: Should be katello-cli able to prevent from registering the system twice using different names, something like subscription manager does?
I dont believe so. The Katello CLI is an admin tool.. so I should be able to register lots of different machines. Subscription-manager i registering "this" machine, so it makes sense to stop from double registering.
I was verifying this defect with following build: [root@dhcp193-175 f15]# rpm -qa | grep katello katello-repos-0.1.4-1.el6.noarch katello-cli-0.1.20-1.el6.noarch katello-glue-pulp-0.1.123-1.el6.x86_64 katello-cli-common-0.1.20-1.el6.noarch katello-glue-foreman-0.1.123-1.el6.x86_64 katello-configure-0.1.21-1.el6.noarch katello-glue-candlepin-0.1.123-1.el6.x86_64 katello-common-0.1.123-1.el6.noarch katello-0.1.123-1.el6.x86_64 katello-all-0.1.123-1.el6.x86_64 Following system was already registered. [root@dhcp193-175 f15]# katello -u admin -p admin system list --org ACME_Corporation -------------------------------------------------------------------------------- Systems List For Org [ ACME_Corporation ] Name -------------------------------------------------------------------------------- dhcp201-191.englab.pnq.redhat.com If you re-register the same machine and within same env, you will get the validation failed error twice as below.. katello> system register --name dhcp201-191.englab.pnq.redhat.com --org ACME_Corporation --env test Validation failed: Name has already been taken, Name has already been taken Here message contains "Name has already been taken" twice and it needs to be corrected.
Verified in following katello build: [root@dhcp201-162 ~]# rpm -qa | grep katello katello-0.1.154-1.el6.noarch katello-trusted-ssl-cert-1.0-1.noarch katello-cli-common-0.1.30-1.el6.noarch katello-glue-pulp-0.1.154-1.el6.noarch katello-configure-0.1.46-1.el6.noarch katello-qpid-broker-key-pair-1.0-1.noarch katello-glue-candlepin-0.1.154-1.el6.noarch katello-all-0.1.154-1.el6.noarch katello-repos-0.1.4-1.el6.noarch katello-cli-0.1.30-1.el6.noarch katello-glue-foreman-0.1.154-1.el6.noarch katello-common-0.1.154-1.el6.noarch katello-certs-tools-1.0.1-1.el6.noarch katello-httpd-ssl-key-pair-1.0-1.noarch Registering the same system twice in same org and env throws proper validation message: katello> system register --name dhcp201-139.englab.pnq.redhat.com --org ACME_Corporation --env test Validation failed: Name has already been taken
getting rid of 6.0.0 version since that doesn't exist