Bug 655195 - Missing --consumerid option from pulp-admin consumer bind
Summary: Missing --consumerid option from pulp-admin consumer bind
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: z_other
Version: unspecified
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: ---
Assignee: Jeff Ortel
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On:
Blocks: verified-to-close
TreeView+ depends on / blocked
 
Reported: 2010-11-19 20:31 UTC by Preethi Thomas
Modified: 2011-08-16 14:01 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2011-08-16 14:01:33 UTC
Embargoed:


Attachments (Terms of Use)

Description Preethi Thomas 2010-11-19 20:31:26 UTC
Description of problem:

Looks like the --consumerid option in pulp-admin consumer bind is missing in the latest qe build.


[root@10 ~]# rpm -q pulp
pulp-0.0.108-1.fc14.noarch


[root@10 ~]# pulp-admin consumer bind --help
Usage: pulp-admin <options> consumer bind <options>

Options:
  -h, --help       show this help message and exit
  --repoid=REPOID  repo identifier (required)





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


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Preethi Thomas 2010-11-19 20:37:16 UTC
Looks like the --consumerid is missing from all of the pulp-admin consumer cli

Comment 2 Sayli Karmarkar 2010-12-03 04:09:04 UTC
Fixed.

If your system is not registered to pulp server, it will show id as a required option, else it will show it 'optional': 

$ sudo pulp-admin consumer info --help
Usage: pulp-admin <options> consumer info <options>

Options:
  -h, --help      show this help message and exit
  --id=ID         consumer identifier eg: foo.example.com (required)
  --show-profile  show package profile information associated with this
                  consumer

$ sudo pulp-admin consumer bind --help
Usage: pulp-admin <options> consumer bind <options>

Options:
  -h, --help       show this help message and exit
  --id=ID          consumer identifier eg: foo.example.com (required)
  --repoid=REPOID  repo identifier (required)


$ sudo pulp-admin consumer bind --help
Usage: pulp-admin <options> consumer bind <options>

Options:
  -h, --help       show this help message and exit
  --id=ID          consumer identifier eg: foo.example.com
  --repoid=REPOID  repo identifier (required)

Comment 3 Jay Dobies 2010-12-03 18:24:17 UTC
Fixed in build 0.111.

Comment 4 Preethi Thomas 2010-12-06 15:03:45 UTC
Reopening.

[root@10 ~]# rpm -q pulp
pulp-0.0.111-1.fc14.noarch

Here is what I am seeing

1. I deleted the consumer

[root@10 ~]# pulp-admin consumer delete
Successfully deleted consumer [10.16.79.211]

2. I don't see the --id (required) as in the example above

[root@10 ~]# pulp-admin consumer bind --help
Usage: pulp-admin <options> consumer bind <options>

Options:
  -h, --help       show this help message and exit
  --id=ID          consumer identifier eg: foo.example.com
  --repoid=REPOID  repo identifier (required)

3. I ran the consumer delete again to make sure that its deleted

[root@10 ~]# pulp-admin consumer delete
error: operation failed: "Traceback (most recent call last):\n  File \"/usr/lib/python2.7/site-packages/pulp/server/webservices/controllers/base.py\", line 53, in report_error\n    return method(self, *args, **kwargs)\n  File \"/usr/lib/python2.7/site-packages/pulp/server/webservices/role_check.py\", line 124, in check_roles\n    result = f(instance, *fargs, **kw)\n  File \"/usr/lib/python2.7/site-packages/pulp/server/webservices/controllers/consumers.py\", line 155, in DELETE\n    consumer_api.delete(id=id)\n  File \"/usr/lib/python2.7/site-packages/pulp/server/event/dispatcher.py\", line 105, in call\n    retval = fn(*args, **kwargs)\n  File \"/usr/lib/python2.7/site-packages/pulp/server/auditing.py\", line 199, in _audit\n    result = method(*args, **kwargs)\n  File \"/usr/lib/python2.7/site-packages/pulp/server/api/consumer.py\", line 93, in delete\n    raise PulpException('Consumer [%s] does not exist', id)\nPulpException: u'Consumer [10.16.79.211] does not exist'\n"

4. Notice that --d is not listed as required

[root@10 ~]# pulp-admin consumer bind --help
Usage: pulp-admin <options> consumer bind <options>

Options:
  -h, --help       show this help message and exit
  --id=ID          consumer identifier eg: foo.example.com
  --repoid=REPOID  repo identifier (required)

5. Now I try to bind any way with the --id option

[root@10 ~]# pulp-admin consumer bind --id=10.16.79.211 --repoid=f13test
error: operation failed: "Traceback (most recent call last):\n  File \"/usr/lib/python2.7/site-packages/pulp/server/webservices/controllers/base.py\", line 53, in report_error\n    return method(self, *args, **kwargs)\n  File \"/usr/lib/python2.7/site-packages/pulp/server/webservices/controllers/consumers.py\", line 484, in POST\n    return action(id)\n  File \"/usr/lib/python2.7/site-packages/pulp/server/webservices/role_check.py\", line 124, in check_roles\n    result = f(instance, *fargs, **kw)\n  File \"/usr/lib/python2.7/site-packages/pulp/server/webservices/controllers/consumers.py\", line 273, in bind\n    consumer_api.bind(id, data)\n  File \"/usr/lib/python2.7/site-packages/pulp/server/auditing.py\", line 199, in _audit\n    result = method(*args, **kwargs)\n  File \"/usr/lib/python2.7/site-packages/pulp/server/api/consumer.py\", line 317, in bind\n    raise PulpException('Consumer [%s] not found', id)\nPulpException: u'Consumer [10.16.79.211] not found'\n"

Also now I see --id option with the pulp-client consumer as well. My understanding is pulp-client should not have that option

[root@10 ~]# pulp-client consumer bind --help
Usage: pulp-client <options> consumer bind <options>

Options:
  -h, --help       show this help message and exit
  --id=ID          consumer identifier eg: foo.example.com
  --repoid=REPOID  repo identifier (required)

Comment 5 Jeff Ortel 2011-01-05 16:30:06 UTC
This works correctly when the consumer is not registered to pulp.  After doing a 'pulp-client consumer delete' which removes the consumer certificate, pulp-admin requires --id.  The issue is that pulp-admin deletes the consumer on the server but does not clean up the client.  Namely, the consumer certificate in /etc/pki/consumer/* and pulp-admin thinks the consumer is still registered and does not require the --id argument.

Adding logic in both server API ConsumerApi.delete() and on the client (gofer plugin)
to ensure clean up of registration artifacts when a consumer is deleted.

Comment 6 Jeff Ortel 2011-01-05 17:19:52 UTC
Fixed ac9b2e2c5bdfc32cba5cab94d03256a836620e5d
Server does asynchronous RMI to consumer to clean up the consumer cert.  After which, the pulp-admin tool will work as expected.

Comment 7 Jay Dobies 2011-01-05 19:45:17 UTC
Fixed in 0.120.

Comment 8 Preethi Thomas 2011-01-06 19:25:52 UTC
verified

[root@pulp-f13 ~]# rpm -q pulp
pulp-0.0.121-1.fc13.noarch



[root@pulp-f13 ~]# pulp-admin consumer list
+------------------------------------------+
            Consumer Information
+------------------------------------------+

Id                 	10.16.79.185             
Description        	None                     
Subscribed Repos   	/pulp/api/consumers/10.16.79.185/repoids/
Additional info    	{}                       

[root@pulp-f13 ~]# 
[root@pulp-f13 ~]# 
[root@pulp-f13 ~]# 
[root@pulp-f13 ~]# pulp-client consumer delete
Successfully deleted consumer [10.16.79.185]

[root@pulp-f13 ~]# 
[root@pulp-f13 ~]# 
[root@pulp-f13 ~]# 
[root@pulp-f13 ~]# 
[root@pulp-f13 ~]# pulp-admin consumer bind --help
Usage: pulp-admin <options> consumer bind <options>

Options:
  -h, --help       show this help message and exit
  --id=ID          consumer identifier eg: foo.example.com (required)
  --repoid=REPOID  repo identifier (required)

Comment 9 Preethi Thomas 2011-08-16 14:01:33 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.