From 3874ea6e672a86467390c5bbe148576e9883f17d Mon Sep 17 00:00:00 2001 From: Lei Wang Date: Fri, 22 Nov 2024 16:37:57 -0500 Subject: [PATCH] PR changes --- .../engines/high_throughput/engine.py | 8 ++++---- compute_endpoint/tests/unit/test_engines.py | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/compute_endpoint/globus_compute_endpoint/engines/high_throughput/engine.py b/compute_endpoint/globus_compute_endpoint/engines/high_throughput/engine.py index 2a5412e92..05f3eccf6 100644 --- a/compute_endpoint/globus_compute_endpoint/engines/high_throughput/engine.py +++ b/compute_endpoint/globus_compute_endpoint/engines/high_throughput/engine.py @@ -302,8 +302,9 @@ def __init__( if not HighThroughputEngine.is_hostname_or_ip(address): err_msg = ( - f"Invalid address supplied: ({address}) " - "Please use a valid hostname or IPv4/IPv6 address" + # yes, suggesting `=` formatter, so it's clear which argument. + f"Invalid address: {address=}\n\n" + "Expecting an interface name, hostname, IPv4 address, or IPv6 address." ) log.critical(err_msg) raise ValueError(err_msg) @@ -424,8 +425,7 @@ def start( def is_hostname_or_ip(hostname_or_ip: str) -> bool: """ Utility method to verify that the input is a valid hostname or - IP address. This is potentially useful elsewhere, if used, - should we move it to another module? + IP address. """ if not hostname_or_ip: return False diff --git a/compute_endpoint/tests/unit/test_engines.py b/compute_endpoint/tests/unit/test_engines.py index e8b27ecbf..03e0368d3 100644 --- a/compute_endpoint/tests/unit/test_engines.py +++ b/compute_endpoint/tests/unit/test_engines.py @@ -414,5 +414,4 @@ def test_gcmpiengine_accepts_resource_specification(task_uuid, randomstring): ), ) def test_hostname_or_ip_validation(input, is_valid): - result = HighThroughputEngine.is_hostname_or_ip(input) - assert is_valid == result + assert HighThroughputEngine.is_hostname_or_ip(input) is is_valid