Bug 1023125 - hammer-cli: trying to create duplicate org throws unhandled ISE
hammer-cli: trying to create duplicate org throws unhandled ISE
Status: CLOSED CURRENTRELEASE
Product: Red Hat Satellite 6
Classification: Red Hat
Component: API (Show other bugs)
6.0.2
Unspecified Unspecified
unspecified Severity medium (vote)
: Unspecified
: --
Assigned To: Daniel Lobato Garcia
Og Maciel
http://projects.theforeman.org/issues...
: Triaged
: 1062306 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-24 12:47 EDT by Corey Welton
Modified: 2016-04-22 12:05 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-07-02 10:06:09 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 3519 None None None 2016-04-22 12:05 EDT

  None (edit)
Description Corey Welton 2013-10-24 12:47:17 EDT
Description of problem:

When trying to create an org in foreman when an org with the same name already exists, an ISE is thrown.  This is incongruent with such behavior for other subcommands

Version-Release number of selected component (if applicable):
Satellite-6.0.2-RHEL-6-20131023.1


How reproducible:


Steps to Reproduce:
1. 'hammer -u admin -p admin organization create --name foobar' ; note org is created
2.  'hammer -u admin -p admin organization create --name foobar'
3.  View results

Actual results:
[root@cloud-qe-21 ~]# hammer -u admin -p admin organization create --name foobar
Could not create the organization:
  Error: 500 Internal Server Error


Expected results:
Something like "Organization creation failed: An organization with this name already exists"

Additional info:
Comment 1 Corey Welton 2013-10-24 12:48:56 EDT
Likewise, attempting to modify an org to have the same name as an existing one throws the same error.
Comment 4 Dominic Cleal 2013-10-25 09:46:48 EDT
Turns out to be a Foreman API error.  Please include production.log info when you get HTTP error codes like this.
Comment 7 Dominic Cleal 2014-02-06 11:57:37 EST
*** Bug 1062306 has been marked as a duplicate of this bug. ***
Comment 9 Bryan Kearney 2014-02-18 09:40:35 EST
checked into upstream.
Comment 11 Og Maciel 2014-03-11 12:28:52 EDT
DEBUG basecli:43: Running test TestOrg/test_bugzilla_1023125
DEBUG ssh:100: >>> LANG=en_US hammer -v -u admin -p changeme --output csv organization create --name='ucwoer'
DEBUG ssh:153: <<< ['Message,Id,Name', 'Organization created,171,ucwoer', '']
DEBUG ssh:100: >>> LANG=en_US hammer -v -u admin -p changeme --output csv organization info --id='171'
DEBUG ssh:153: <<< ['Id,Name,Created at,Updated at,Label,Description', '171,ucwoer,2014/03/11 16:27:16,2014/03/11 16:27:16,ucwoer,""', '']
DEBUG ssh:100: >>> LANG=en_US hammer -v -u admin -p changeme --output csv organization list --search='label="ucwoer"'
DEBUG ssh:153: <<< ['Id,Name,Label,Description', '171,ucwoer,ucwoer,""', '']
DEBUG ssh:100: >>> LANG=en_US hammer -v -u admin -p changeme --output csv organization create --name='ucwoer'
DEBUG ssh:156: <<< [ERROR 2014-03-11 12:27:26 Exception] Name has already been taken
Name has already been taken
Title has already been taken
Label already exists (including organizations being deleted)
Organization Names and labels must be unique across all organizations
Could not create the organization:
  Name has already been taken
  Name has already been taken
  Title has already been taken
  Label already exists (including organizations being deleted)
  Organization Names and labels must be unique across all organizations

DEBUG factory:78: [ERROR 2014-03-11 12:27:26 Exception] Name has already been taken
Name has already been taken
Title has already been taken
Label already exists (including organizations being deleted)
Organization Names and labels must be unique across all organizations
Could not create the organization:
  Name has already been taken
  Name has already been taken
  Title has already been taken
  Label already exists (including organizations being deleted)
  Organization Names and labels must be unique across all organizations

.
----------------------------------------------------------------------
Ran 1 test in 16.700s

OK
Comment 12 Bryan Kearney 2014-07-02 10:06:09 EDT
This was delivered with 6.0.3, which is the Satellite 6 Beta.

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