From: Adam King Date: Sat, 23 Sep 2023 16:16:06 +0000 (-0400) Subject: cephadm: re-format black data_utils.py X-Git-Tag: v19.0.0~384^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=91cbbaf799283aee5f5c9a4ce8bff2334861106b;p=ceph-ci.git cephadm: re-format black data_utils.py Signed-off-by: Adam King --- diff --git a/src/cephadm/cephadmlib/data_utils.py b/src/cephadm/cephadmlib/data_utils.py index 21fceb54ccf..9493a37d00f 100644 --- a/src/cephadm/cephadmlib/data_utils.py +++ b/src/cephadm/cephadmlib/data_utils.py @@ -138,7 +138,11 @@ def try_convert_datetime(s): for f in fmts: try: # return timestamp normalized to UTC, rendered as DATEFMT. - return datetime.datetime.strptime(s, f).astimezone(tz=datetime.timezone.utc).strftime(DATEFMT) + return ( + datetime.datetime.strptime(s, f) + .astimezone(tz=datetime.timezone.utc) + .strftime(DATEFMT) + ) except ValueError: pass return None @@ -188,6 +192,8 @@ def get_legacy_config_fsid(cluster, legacy_dir=None): if os.path.exists(config_file): config = read_config(config_file) - if config.has_section('global') and config.has_option('global', 'fsid'): + if config.has_section('global') and config.has_option( + 'global', 'fsid' + ): return config.get('global', 'fsid') return None