mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2025-01-24 12:47:05 +00:00
Fixed RUF010 (explicit-f-string-type-conversion): Use explicit conversion flag
This commit is contained in:
parent
350b5b035a
commit
385ac086e6
@ -515,7 +515,7 @@ def check_certificate(domain, ssl_certificate, ssl_private_key, warn_if_expiring
|
|||||||
cert = load_pem(ssl_cert_chain[0])
|
cert = load_pem(ssl_cert_chain[0])
|
||||||
if not isinstance(cert, Certificate): raise ValueError("This is not a certificate file.")
|
if not isinstance(cert, Certificate): raise ValueError("This is not a certificate file.")
|
||||||
except ValueError as e:
|
except ValueError as e:
|
||||||
return (f"There is a problem with the certificate file: {str(e)}", None)
|
return (f"There is a problem with the certificate file: {e!s}", None)
|
||||||
|
|
||||||
# First check that the domain name is one of the names allowed by
|
# First check that the domain name is one of the names allowed by
|
||||||
# the certificate.
|
# the certificate.
|
||||||
|
@ -248,7 +248,7 @@ def check_free_disk_space(rounded_values, env, output):
|
|||||||
def check_free_memory(rounded_values, env, output):
|
def check_free_memory(rounded_values, env, output):
|
||||||
# Check free memory.
|
# Check free memory.
|
||||||
percent_free = 100 - psutil.virtual_memory().percent
|
percent_free = 100 - psutil.virtual_memory().percent
|
||||||
memory_msg = f"System memory is {str(round(percent_free))}% free."
|
memory_msg = f"System memory is {round(percent_free)!s}% free."
|
||||||
if percent_free >= 20:
|
if percent_free >= 20:
|
||||||
if rounded_values: memory_msg = "System free memory is at least 20%."
|
if rounded_values: memory_msg = "System free memory is at least 20%."
|
||||||
output.print_ok(memory_msg)
|
output.print_ok(memory_msg)
|
||||||
|
Loading…
Reference in New Issue
Block a user