Bug 631017

Summary: consumer history option errors
Product: [Retired] Pulp Reporter: Preethi Thomas <pthomas>
Component: z_otherAssignee: Jay Dobies <jason.dobies>
Status: CLOSED CURRENTRELEASE QA Contact: Preethi Thomas <pthomas>
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: jason.dobies, tsanders, whayutin
Target Milestone: ---Keywords: Reopened, Triaged
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-02-17 16:51:44 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 647488    

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