| 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: | vdsm | Assignee: | Erez Shinan <erez> |
| Status: | CLOSED ERRATA | QA Contact: | David Naori <dnaori> |
| Severity: | low | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 6.1 | CC: | 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: | |
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 Development Management has reviewed and declined this request. You may appeal this decision by reopening this request. Thanks, we'll parse it in vdsm. Since the component specifies vdsm, please also specify where in vdsm does this bug occur. (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')) 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 Verified vdsm-4.9-82.el6.
kernel': {'release': '158.el6.x86_64', 'buildtime': 1308039694.0, 'version': '2.6.32'}
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 |
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: