ia64/xen-unstable

changeset 14790:28efbe0ea490

Make date time handling slightly more permissive

signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
author Tom Wilkie <tom.wilkie@gmail.com>
date Tue Apr 10 17:01:40 2007 +0100 (2007-04-10)
parents 4add9eb83f7f
children dbeabe1d225c
files tools/python/xen/xm/main.py
line diff
     1.1 --- a/tools/python/xen/xm/main.py	Mon Apr 09 17:09:21 2007 +0100
     1.2 +++ b/tools/python/xen/xm/main.py	Tue Apr 10 17:01:40 2007 +0100
     1.3 @@ -732,8 +732,10 @@ def xm_restore(args):
     1.4  
     1.5  
     1.6  def datetime_to_secs(v):
     1.7 -    return time.mktime(time.strptime(str(v) + 'UTC', '%Y%m%dT%H:%M:%S%Z'))
     1.8 -
     1.9 +    unwanted = ":-."
    1.10 +    for c in unwanted:
    1.11 +        v = str(v).replace(c, "")
    1.12 +    return time.mktime(time.strptime(v[0:14], '%Y%m%dT%H%M%S'))
    1.13  
    1.14  def getDomains(domain_names, state, full = 0):
    1.15      if serverType == SERVER_XEN_API: