run pre-commit upgrade code for Py3.8+ again

This commit is contained in:
jeanluc 2023-06-21 22:16:30 +02:00 committed by Megan Wilhite
parent 31cf73704f
commit 830232f9e9
2 changed files with 6 additions and 6 deletions

View file

@ -29,18 +29,18 @@ def _sync_single(name, module, **kwargs):
if __opts__["test"]:
ret["result"] = None
ret["comment"] = "saltutil.sync_{} would have been run".format(module)
ret["comment"] = f"saltutil.sync_{module} would have been run"
return ret
try:
sync_status = __salt__["saltutil.sync_{}".format(module)](**kwargs)
sync_status = __salt__[f"saltutil.sync_{module}"](**kwargs)
if sync_status:
ret["changes"][module] = sync_status
ret["comment"] = "Updated {}.".format(module)
ret["comment"] = f"Updated {module}."
except Exception as e: # pylint: disable=broad-except
log.error("Failed to run saltutil.sync_%s: %s", module, e)
ret["result"] = False
ret["comment"] = "Failed to run sync_{}: {}".format(module, e)
ret["comment"] = f"Failed to run sync_{module}: {e}"
return ret
if not ret["changes"]:
@ -76,7 +76,7 @@ def sync_all(name, **kwargs):
except Exception as e: # pylint: disable=broad-except
log.error("Failed to run saltutil.sync_all: %s", e)
ret["result"] = False
ret["comment"] = "Failed to run sync_all: {}".format(e)
ret["comment"] = f"Failed to run sync_all: {e}"
return ret
if not ret["changes"]:

View file

@ -142,4 +142,4 @@ def test_saltutil_sync_states_should_match_saltutil_module():
for fn in module_functions:
assert (
fn in state_functions
), "modules.saltutil.{} has no matching state in states.saltutil".format(fn)
), f"modules.saltutil.{fn} has no matching state in states.saltutil"