Bug 631017 - consumer history option errors
Summary: consumer history option errors
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: z_other
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Jay Dobies
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On:
Blocks: verified-to-close
TreeView+ depends on / blocked
 
Reported: 2010-09-07 16:01 UTC by Preethi Thomas
Modified: 2011-07-15 19:29 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2011-02-17 16:51:44 UTC
Embargoed:


Attachments (Terms of Use)

Description Preethi Thomas 2010-09-07 16:01:29 UTC
Description of problem:


pulp-admin consumer history errors out when not using the --help option

[root@preethi ~]# pulp-admin consumer history
Traceback (most recent call last):
  File "/usr/bin/pulp-admin", line 30, in <module>
    pulpcli.PulpCore().main()
  File "/usr/lib/python2.6/site-packages/pulp/client/pulpcli.py", line 108, in main
    cmd.main()
  File "/usr/lib/python2.6/site-packages/pulp/client/core/basecore.py", line 120, in main
    self._do_core()
  File "/usr/lib/python2.6/site-packages/pulp/client/core/core_consumer.py", line 140, in _do_core
    self._history()
  File "/usr/lib/python2.6/site-packages/pulp/client/core/core_consumer.py", line 282, in _history
    consumerid = self.getConsumer()
  File "/usr/lib/python2.6/site-packages/pulp/client/core/core_consumer.py", line 326, in getConsumer
    if not self.options.id:
AttributeError: Values instance has no attribute 'id'




[root@preethi ~]# pulp-client -u admin -p admin consumer history
 History retrieval failed for consumer [preethi.usersys.redhat.com]

Comment 1 Jay Dobies 2010-09-07 16:27:21 UTC
History isn't supported yet from pulp-admin.

As for pulp-client, talking in the chat room "consumer create" hadn't been run yet. I'm leaving this bug open to make the error message more useful.

Comment 2 Pradeep Kilambi 2010-09-08 15:49:33 UTC

*** This bug has been marked as a duplicate of bug 631526 ***

Comment 3 Pradeep Kilambi 2010-09-08 17:57:05 UTC
this is a bug in consumer history for pulp-admin.

* all pulp-admin actions require a id.. if you prefer to read the certs, use pulp-client consumer history for local consumer
* I suggest we add a --id for an admin to see history for any consumer
* fyi pulp-admin is for any consumer not jus local

for pulp-client it will be handled in bug 631526

reopening and assigning to jdob for further enhancements.

Comment 4 Jay Dobies 2010-10-20 20:38:26 UTC
I just double checked, this works fine as of 0.75.

Comment 5 Jay Dobies 2010-10-26 14:47:10 UTC
Fixed in build 0.76.

Comment 6 Preethi Thomas 2010-10-28 14:52:32 UTC
verified

[root@preethi ~]# pulp-admin consumer history  --start_date=2010-10-26 --end_date=2010-10-26 
Usage: pulp-admin <options> consumer history <options>

pulp-admin: error: Option --id is required; please see --help

[root@preethi ~]# pulp-client consumer history  --start_date=2010-10-26 --end_date=2010-10-26 
+------------------------------------------+
              Consumer History
+------------------------------------------+

You have new mail in /var/spool/mail/root
[root@preethi ~]# 
[root@preethi ~]# 
[root@preethi ~]# pulp-client consumer history  --start_date=2010-10-26 --end_date=2010-10-27
+------------------------------------------+
              Consumer History
+------------------------------------------+

Event Type              Consumer Created         
Timestamp               2010-10-26 16:04:47.365000
Originator              admin                    

Event Type              Consumer Deleted         
Timestamp               2010-10-26 16:04:42.086000
Originator              admin                    

Event Type              Consumer Created         
Timestamp               2010-10-26 16:03:14.234000
Originator              admin                    

Event Type              Consumer Deleted         
Timestamp               2010-10-26 15:39:05.124000
Originator              admin                    

Event Type              Consumer Created         
Timestamp               2010-10-26 15:38:53.357000
Originator              admin                    


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

Options:
  -h, --help            show this help message and exit
  --event_type=EVENT_TYPE
                        limits displayed history entries to the given type
  --limit=LIMIT         limits displayed history entries to the given amount
                        (must be greater than zero)
  --sort=SORT           indicates the sort direction ("ascending" or
                        "descending") based on the entry's timestamp
  --start_date=START_DATE
                        only return entries that occur on or after the given
                        date (format: yyyy-mm-dd)
  --end_date=END_DATE   only return entries that occur on or before the given
                        date (format: yyyy-mm-dd)
[root@preethi ~]# 
[root@preethi ~]# pulp-admin consumer history --help
Usage: pulp-admin <options> consumer history <options>

Options:
  -h, --help            show this help message and exit
  --id=ID               consumer identifier eg: foo.example.com (required)
  --event_type=EVENT_TYPE
                        limits displayed history entries to the given type
  --limit=LIMIT         limits displayed history entries to the given amount
                        (must be greater than zero)
  --sort=SORT           indicates the sort direction ("ascending" or
                        "descending") based on the entry's timestamp
  --start_date=START_DATE
                        only return entries that occur on or after the given
                        date (format: yyyy-mm-dd)
  --end_date=END_DATE   only return entries that occur on or before the given
                        date (format: yyyy-mm-dd)

Comment 7 Preethi Thomas 2011-02-17 16:51:44 UTC
Closing with community release 

pulp-0.0.139-1.fc14.noarch


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