Bug 609445 - Error on registering duplicate consumer .
Summary: Error on registering duplicate consumer .
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: z_other
Version: unspecified
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
: ---
Assignee: Pradeep Kilambi
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: pulp-verified
TreeView+ depends on / blocked
 
Reported: 2010-06-30 10:31 UTC by Shveta
Modified: 2011-08-16 14:00 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-08-16 14:00:38 UTC
Embargoed:


Attachments (Terms of Use)

Description Shveta 2010-06-30 10:31:04 UTC
Description of problem:Error on registering duplicate consumer .Error should be caught and handled with proper error message


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.Register a consumer
2. Register same consumer again.
3.
  
Actual results:


Expected results:


Additional info:

[root@shveta ~]# pulp consumer register --id=10.65.193.89
Traceback (most recent call last):
  File "/usr/bin/pulp", line 26, in <module>
    pulpcli.PulpCore().main()
  File "/usr/lib/python2.6/site-packages/pulp-0.0.6-py2.6.egg/pulptools/pulpcli.py", line 102, in main
    cmd.main()
  File "/usr/lib/python2.6/site-packages/pulp-0.0.6-py2.6.egg/pulptools/core/basecore.py", line 43, in main
    self._do_core()
  File "/usr/lib/python2.6/site-packages/pulp-0.0.6-py2.6.egg/pulptools/core/core_consumer.py", line 122, in _do_core
    self._create()
  File "/usr/lib/python2.6/site-packages/pulp-0.0.6-py2.6.egg/pulptools/core/core_consumer.py", line 144, in _create
    consumer = self.cconn.create(self.options.id, self.options.description)
  File "/usr/lib/python2.6/site-packages/pulp-0.0.6-py2.6.egg/pulptools/connection.py", line 188, in create
    return self.conn.request_put(method, params=consumerdata)
  File "/usr/lib/python2.6/site-packages/pulp-0.0.6-py2.6.egg/pulptools/connection.py", line 85, in request_put
    return self._request("PUT", method, params)
  File "/usr/lib/python2.6/site-packages/pulp-0.0.6-py2.6.egg/pulptools/connection.py", line 64, in _request
    self.validateResponse(response)
  File "/usr/lib/python2.6/site-packages/pulp-0.0.6-py2.6.egg/pulptools/connection.py", line 72, in validateResponse
    raise RestlibException(response.status, response.read())
pulptools.connection.RestlibException: "Traceback (most recent call last):\n  File \"/usr/lib/python2.6/site-packages/pulp-0.0.6-py2.6.egg/juicer/controllers/base.py\", line 49, in report_error\n    return method(self, *args, **kwargs)\n  File \"/usr/lib/python2.6/site-packages/pulp-0.0.6-py2.6.egg/juicer/controllers/consumers.py\", line 54, in PUT\n    consumer = API.create(consumer_data['id'], consumer_data['description'])\n  File \"/usr/lib/python2.6/site-packages/pulp-0.0.6-py2.6.egg/pulp/api/consumer.py\", line 46, in create\n    self.insert(c)\n  File \"/usr/lib/python2.6/site-packages/pulp-0.0.6-py2.6.egg/pulp/api/base.py\", line 63, in insert\n    self.objectdb.insert(object, check_keys=check_keys, safe=True)\n  File \"/usr/lib64/python2.6/site-packages/pymongo/collection.py\", line 245, in insert\n    message.insert(self.__full_name, docs, check_keys, safe), safe)\n  File \"/usr/lib64/python2.6/site-packages/pymongo/connection.py\", line 570, in _send_message\n    return self.__check_response_to_last_error(response)\n  File \"/usr/lib64/python2.6/site-packages/pymongo/connection.py\", line 540, in __check_response_to_last_error\n    raise DuplicateKeyError(error[\"err\"])\nDuplicateKeyError: E11000 duplicate key error index: _database.consumers.$_id_  dup key: { : \"10.65.193.89\" }\n"

Comment 2 Shveta 2010-07-09 05:36:26 UTC
[root@shveta ~]# pulp consumer register --id=10.65.193.75
"Consumer with id: 10.65.193.75, already exists"
[root@shveta ~]# pulp consumer register --id=10.65.193.26
[root@shveta ~]# pulp consumer register --id=10.65.193.26
"Consumer with id: 10.65.193.26, already exists"

verified , However it registers even if i do not provide a proper hostname or IP
like below , abc is not a hostname or IP .
Can it check for proper hostname .

[root@shveta ~]# pulp consumer register --id=abc
[root@shveta ~]# pulp repo delete --label=abc
 Deleted operation failed on Repo [ abc ]

Comment 4 Preethi Thomas 2011-08-16 14:00:38 UTC
Closing with Community Release 15

pulp-0.0.223-4.


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