From: Michael Fritch Date: Thu, 12 Mar 2020 19:33:11 +0000 (-0600) Subject: cephadm: fix datetime regexp to capture at most 6 digits X-Git-Tag: v15.1.1~9^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=256a99d103bf75932a425836f44e8928fc259bf0;p=ceph-ci.git cephadm: fix datetime regexp to capture at most 6 digits trailing `0` digits are not shown in the precision Signed-off-by: Michael Fritch --- diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index 8d97a381cd9..fa74cc81bfa 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -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