From e62153e38d403b4f1e6d7c6e48dc6339c1796d1f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 29 Apr 2024 23:25:36 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- creation/lib/cWParams.py | 6 +++--- doc/factory/custom_vars.html | 11 ++++++----- frontend/glideinFrontendElement.py | 12 ++++++------ frontend/glideinFrontendInterface.py | 2 +- lib/config_util.py | 2 +- 5 files changed, 17 insertions(+), 16 deletions(-) diff --git a/creation/lib/cWParams.py b/creation/lib/cWParams.py index d80a35f32..7749c48be 100644 --- a/creation/lib/cWParams.py +++ b/creation/lib/cWParams.py @@ -106,9 +106,9 @@ def validate(self, base, path_text): # list of elements if isinstance(self.data[k], OrderedDict): if len(list(self.data[k].keys())) == 0: - self.data[ - k - ] = [] # XML does not know if an empty list is a dictionary or not.. fix this + self.data[k] = ( + [] + ) # XML does not know if an empty list is a dictionary or not.. fix this mylist = self[k] if not isinstance(mylist, list): diff --git a/doc/factory/custom_vars.html b/doc/factory/custom_vars.html index 594a4f844..e8f06b753 100644 --- a/doc/factory/custom_vars.html +++ b/doc/factory/custom_vars.html @@ -1029,11 +1029,12 @@

>MEMORY

-

- Note that HTCondor-CEs ignore RequestMemory. if you like to set the - memory or change the default 2GB minimum, you need to set maxMemory, e.g. - +maxMemory=RequestMemory in the submit_attrs section. -

+

+ Note that HTCondor-CEs ignore RequestMemory. if you like to set + the memory or change the default 2GB minimum, you need to set + maxMemory, e.g. + +maxMemory=RequestMemory in the submit_attrs section. +

diff --git a/frontend/glideinFrontendElement.py b/frontend/glideinFrontendElement.py index 2cac48100..bb01e9874 100755 --- a/frontend/glideinFrontendElement.py +++ b/frontend/glideinFrontendElement.py @@ -2359,16 +2359,16 @@ def subprocess_count_glidein(self, glidein_list): cred_dict = glideinFrontendLib.getClientCondorStatusCredIdOnly(req_dict, cred_id) if st in ("TotalCores", "IdleCores", "RunningCores"): - count_status_multi_per_cred[request_name][cred_id][ - st - ] = glideinFrontendLib.countCoresCondorStatus(cred_dict, st) + count_status_multi_per_cred[request_name][cred_id][st] = ( + glideinFrontendLib.countCoresCondorStatus(cred_dict, st) + ) elif st == "Running": # Running counts are computed differently because of # the dict composition. Dict also has p-slots # corresponding to the dynamic slots - count_status_multi_per_cred[request_name][cred_id][ - st - ] = glideinFrontendLib.countRunningCondorStatus(cred_dict) + count_status_multi_per_cred[request_name][cred_id][st] = ( + glideinFrontendLib.countRunningCondorStatus(cred_dict) + ) else: count_status_multi_per_cred[request_name][cred_id][st] = glideinFrontendLib.countCondorStatus( cred_dict diff --git a/frontend/glideinFrontendInterface.py b/frontend/glideinFrontendInterface.py index e18c016e7..6c7be85cb 100644 --- a/frontend/glideinFrontendInterface.py +++ b/frontend/glideinFrontendInterface.py @@ -1388,7 +1388,7 @@ def writeTypedClassadAttrToFile(fd, attr_name, attr_value): """ Given the FD, type check the value and write the info the classad file """ - if isinstance(attr_value, (int, int, float)): + if isinstance(attr_value, (int, float)): # don't quote numeric values fd.write(f"{attr_name} = {attr_value}\n") else: diff --git a/lib/config_util.py b/lib/config_util.py index 92a762418..71b8f92fc 100644 --- a/lib/config_util.py +++ b/lib/config_util.py @@ -273,7 +273,7 @@ def update(data, update_data, overwrite=True): if value is None: if key in data: del data[key] - elif isinstance(value, collections.Mapping): + elif isinstance(value, collections.abc.Mapping): sub_data = data.get(key, {}) if sub_data is not None: data[key] = update(sub_data, value, overwrite)