Skip to content

Commit

Permalink
Replace f-strings with standard strings, for Python 3.5 compatibility (
Browse files Browse the repository at this point in the history
  • Loading branch information
DZPM authored and codingjoe committed Mar 15, 2018
1 parent cbda97c commit 0020b53
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions health_check/contrib/psutil/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ def check_status(self):
du = psutil.disk_usage('/')
if DISK_USAGE_MAX and du.percent >= DISK_USAGE_MAX:
raise ServiceWarning(
f"{host} {du.percent}% disk usage exceeds {DISK_USAGE_MAX}%"
"{host} {percent}% disk usage exceeds {disk_usage}%".format(
host=host, percent=du.percent, disk_usage=DISK_USAGE_MAX)
)
except ValueError as e:
self.add_error(ServiceReturnedUnexpectedResult("ValueError"), e)
Expand All @@ -40,7 +41,8 @@ def check_status(self):
avail = '{:n}'.format(int(memory.available / 1024 / 1024))
threshold = '{:n}'.format(MEMORY_MIN)
raise ServiceWarning(
f"{host} {avail} MB available RAM below {threshold} MB"
"{host} {avail} MB available RAM below {threshold} MB".format(
host=host, avail=avail, threshold=threshold)
)
except ValueError as e:
self.add_error(ServiceReturnedUnexpectedResult("ValueError"), e)

0 comments on commit 0020b53

Please sign in to comment.