python: Convert percent formatting to Python 3.6 f-strings.

Generated by pyupgrade --py36-plus.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2020-06-09 21:41:04 -07:00
committed by Tim Abbott
parent 6480deaf27
commit 67e7a3631d
217 changed files with 776 additions and 846 deletions

View File

@@ -81,7 +81,5 @@ for queue_name in consumers.keys():
else:
status = 0
with open(state_file_tmp, "w") as f:
f.write("%s|%s|%s|queue %s has %s consumers, needs %s\n" % (
now, status, states[status], queue_name,
consumers[queue_name], target_count))
f.write(f"{now}|{status}|{states[status]}|queue {queue_name} has {consumers[queue_name]} consumers, needs {target_count}\n")
os.rename(state_file_tmp, state_file_path)

View File

@@ -32,4 +32,4 @@ def nagios_from_file(results_file: str) -> Tuple[int, str]:
state = pieces[2]
data = pieces[3]
return (ret, "%s: %s" % (state, data))
return (ret, f"{state}: {data}")