Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 29, 2024
1 parent c668e4a commit 8272ecb
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions creation/lib/cWParams.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
12 changes: 6 additions & 6 deletions frontend/glideinFrontendElement.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion frontend/glideinFrontendInterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion lib/config_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8272ecb

Please sign in to comment.