Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 716675

Summary: ValueError when formatting time-zone to one that does not exist in TZ environment variable.
Product: Red Hat Enterprise Linux 6 Reporter: David Naori <dnaori>
Component: vdsmAssignee: Erez Shinan <erez>
Status: CLOSED ERRATA QA Contact: David Naori <dnaori>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.1CC: abaron, bazulay, danken, dnaori, hateya, iheim, ilvovsky, mgoldboi, ykaul
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: vdsm-4.9-81.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 07:24:53 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:

Description David Naori 2011-06-26 09:59:20 UTC
Description of problem:
ValueError when formatting time-zone to one that dose not exist in TZ environment variable.

#  TZ=EST python -c 'import time;print time.strptime("Tue May 10 15:42:40 EST 2011", "%a %b %d %H:%M:%S %Z %Y")'

time.struct_time(tm_year=2011, tm_mon=5, tm_mday=10, tm_hour=15, tm_min=42, tm_sec=40, tm_wday=1, tm_yday=130, tm_isdst=0)

#  TZ=GMT python -c 'import time;print time.strptime("Tue May 10 15:42:40 EST 2011", "%a %b %d %H:%M:%S %Z %Y")'

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib64/python2.6/_strptime.py", line 454, in _strptime_time
    return _strptime(data_string, format)[0]
  File "/usr/lib64/python2.6/_strptime.py", line 325, in _strptime
    (data_string, format))
ValueError: time data 'Tue May 10 15:42:40 EST 2011' does not match format '%a %b %d %H:%M:%S %Z %Y'


Version-Release number of selected component (if applicable):
python-2.6.6-20.el6.x86_64

How reproducible:
100%

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


Expected results:
strptime %Z should be able to format any time-zone.

Additional info:

Comment 2 Dave Malcolm 2011-07-01 21:42:46 UTC
Quoting http://docs.python.org/library/time.html#time.strptime
"Support for the %Z directive is based on the values contained in tzname and whether daylight is true. Because of this, it is platform-specific except for recognizing UTC and GMT which are always known (and are considered to be non-daylight savings timezones)."

You may want to look at the python-dateutil package; in particular, dateutil.parser.parse

Comment 3 RHEL Program Management 2011-07-01 21:55:12 UTC
Development Management has reviewed and declined this request.  You may appeal
this decision by reopening this request.

Comment 4 Dan Kenigsberg 2011-07-03 08:23:51 UTC
Thanks, we'll parse it in vdsm.

Comment 5 Erez Shinan 2011-07-04 08:02:56 UTC
Since the component specifies vdsm, please also specify where in vdsm does this bug occur.

Comment 6 David Naori 2011-07-04 08:23:24 UTC
(In reply to comment #5)
> Since the component specifies vdsm, please also specify where in vdsm does this
> bug occur.

On vdsm startup:

reproduce step:
/etc/init.d/vdsmd restart && tail -f /var/log/vdsm/vdsm.log | grep -A 10 --color ERROR

Thread-18::ERROR::2011-07-04 11:16:44,865::caps::206::root::(kernelDict) kernel build time not found
Traceback (most recent call last):
  File "/usr/share/vdsm/caps.py", line 204, in kernelDict
    t = time.mktime(time.strptime(t, '%a %b %d %H:%M:%S %Z %Y'))
  File "/usr/lib64/python2.6/_strptime.py", line 454, in _strptime_time
    return _strptime(data_string, format)[0]
  File "/usr/lib64/python2.6/_strptime.py", line 325, in _strptime
    (data_string, format))
ValueError: time data 'Fri Jun 10 10:54:26 EDT 2011' does not match format '%a %b %d %H:%M:%S %Z %Y'

caps.py + 204
t = time.mktime(time.strptime(t, '%a %b %d %H:%M:%S %Z %Y'))

Comment 7 David Naori 2011-07-05 12:53:08 UTC
http://gerrit.usersys.redhat.com/660

Comment 8 Dan Kenigsberg 2011-07-17 11:48:06 UTC
Bug report changed to ON_QA status by me since Errata System refused to do so.
A QE request has been submitted for advisory RHEA-2011:11186-01
http://errata.devel.redhat.com/errata/show/11186

Comment 9 David Naori 2011-07-18 07:28:53 UTC
Verified vdsm-4.9-82.el6.

kernel': {'release': '158.el6.x86_64', 'buildtime': 1308039694.0, 'version': '2.6.32'}

Comment 10 errata-xmlrpc 2011-12-06 07:24:53 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHEA-2011-1782.html