]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: fix datetime regexp to capture at most 6 digits 33932/head
authorMichael Fritch <mfritch@suse.com>
Thu, 12 Mar 2020 19:33:11 +0000 (13:33 -0600)
committerMichael Fritch <mfritch@suse.com>
Thu, 12 Mar 2020 19:37:37 +0000 (13:37 -0600)
trailing `0` digits are not shown in the precision

Signed-off-by: Michael Fritch <mfritch@suse.com>
src/cephadm/cephadm

index 8d97a381cd90a792bb5defab796fee2b5b15e9c9..fa74cc81bfa3dcf30f7ce405fe6fbf0b4e76013e 100755 (executable)
@@ -812,7 +812,7 @@ def try_convert_datetime(s):
 
     # In *all* cases, the 9 digit second precision is too much for
     # python's strptime.  Shorten it to 6 digits.
-    p = re.compile(r'(\.\d\d\d\d\d\d)\d\d\d')
+    p = re.compile(r'(\.[\d]{6})[\d]*')
     s = p.sub(r'\1', s)
 
     # replace trailling Z with -0000, since (on python 3.6.8) it won't parse