From 256a99d103bf75932a425836f44e8928fc259bf0 Mon Sep 17 00:00:00 2001 From: Michael Fritch Date: Thu, 12 Mar 2020 13:33:11 -0600 Subject: [PATCH] cephadm: fix datetime regexp to capture at most 6 digits trailing `0` digits are not shown in the precision Signed-off-by: Michael Fritch --- src/cephadm/cephadm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index 8d97a381cd90a..fa74cc81bfa3d 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 -- 2.39.5