Bug 714745 - cds history --start/end_date returns tzinfo error
Summary: cds history --start/end_date returns tzinfo error
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: nodes
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: Sprint 25
Assignee: Jason Connor
QA Contact: dgao
URL:
Whiteboard:
Depends On:
Blocks: pulp-verified
TreeView+ depends on / blocked
 
Reported: 2011-06-20 15:21 UTC by dgao
Modified: 2014-03-31 01:39 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2011-08-16 13:59:10 UTC
Embargoed:


Attachments (Terms of Use)

Description dgao 2011-06-20 15:21:25 UTC
[root@pulp-nightly pulp]# pulp-admin cds history --hostname pulp-cds-f14.usersys.redhat.com --start_date 2011-06-20
error: operation failed: AttributeError: 'str' object has no attribute 'tzinfo'


2011-06-20 12:15:12,755 1673:139643110795008: pulp.server.webservices.controllers.decorators:ERROR: decorators:50 Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/controllers/decorators.py", line 46, in report_error
    return method(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/controllers/decorators.py", line 125, in _auth_decorator
    value = method(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/controllers/cds.py", line 232, in POST
    return action(id)
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/controllers/cds.py", line 199, in history
    start_date = dateutils.to_local_datetime(start_date)
  File "/usr/lib/python2.7/site-packages/pulp/common/dateutils.py", line 95, in to_local_datetime
    if dt.tzinfo is None:
AttributeError: 'str' object has no attribute 'tzinfo'

Comment 1 Jason Connor 2011-06-20 17:17:42 UTC
fix pushed in f5408e5d5935b3d436e7e5a4ddfdfec7dcb140b1

Comment 2 dgao 2011-06-22 15:15:11 UTC
201106211852:11.680 - FINE: ssh root.redhat.com pulp-admin cds history --hostname pulp-cds-f14.usersys.redhat.com --start_date 2011-06-20 (com.redhat.qe.tools.SSHCommandRunner.run)
201106211852:12.086 - FINE: Stdout:  (com.redhat.qe.tools.SSHCommandRunner.runCommandAndWait)
201106211852:12.086 - FINE: Stderr: error: operation failed: ValueError: need more than 1 value to unpack
 (com.redhat.qe.tools.SSHCommandRunner.runCommandAndWait)
201106211852:12.087 - FINE: ExitCode: 244 (com.redhat.qe.tools.SSHCommandRunner.runCommandAndWait)

2011-06-21 14:49:35,668 4894:140286239958784: pulp.server.webservices.controllers.decorators:ERROR: decorators:51 Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/controllers/decorators.py", line 47, in report_error
    return method(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/controllers/decorators.py", line 126, in _auth_decorator
    value = method(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/controllers/cds.py", line 234, in POST
    return action(id)
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/controllers/cds.py", line 204, in history
    end_date = dateutils.parse_iso8601_datetime(end_date)
  File "/usr/lib/python2.7/site-packages/pulp/common/dateutils.py", line 153, in parse_iso8601_datetime
    return isodate.parse_datetime(datetime_str)
  File "/usr/lib/python2.7/site-packages/isodate/isodatetime.py", line 48, in parse_datetime
    datestring, timestring = datetimestring.split('T')
ValueError: need more than 1 value to unpack

Comment 3 Jason Connor 2011-06-22 20:41:27 UTC
fixed in 45a97df44ef0f067dbef5c3bead3524d1661db97

Comment 4 Jeff Ortel 2011-06-22 21:12:23 UTC
build: 0.196

Comment 5 Jason Connor 2011-06-23 18:49:52 UTC
I fully expect this bug to fail, a new fix has been pushed in f770ce71803677205bacf685c6f0042d05653eb1

Comment 6 Preethi Thomas 2011-07-19 18:03:12 UTC
verified

[root@preethi ~]# rpm -q pulp
pulp-0.0.206-2.fc14.noarch

[root@preethi ~]# pulp-admin cds history --hostname=pulp-cds.usersys.redhat.com --start_date=2011-07-19
+------------------------------------------+
                 CDS History
+------------------------------------------+

Event Type          	Sync Finished            
Timestamp           	2011-07-19 18:00:14+00:00
Originator          	SYSTEM                   

Event Type          	Sync Started             
Timestamp           	2011-07-19 17:25:19+00:00
Originator          	SYSTEM                   

Event Type          	Repo Associated          
Timestamp           	2011-07-19 17:24:59+00:00
Originator          	admin                    
Repo ID               	f14                      

Event Type          	Registered               
Timestamp           	2011-07-19 17:16:12+00:00
Originator          	admin                    

[root@preethi ~]# pulp-admin cds history --hostname=pulp-cds.usersys.redhat.com --end_date=2011-07-20
+------------------------------------------+
                 CDS History
+------------------------------------------+

Event Type          	Sync Finished            
Timestamp           	2011-07-19 18:00:14+00:00
Originator          	SYSTEM                   

Event Type          	Sync Started             
Timestamp           	2011-07-19 17:25:19+00:00
Originator          	SYSTEM                   

Event Type          	Repo Associated          
Timestamp           	2011-07-19 17:24:59+00:00
Originator          	admin                    
Repo ID               	f14                      

Event Type          	Registered               
Timestamp           	2011-07-19 17:16:12+00:00
Originator          	admin

Comment 7 Preethi Thomas 2011-08-16 13:59:10 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.