don't confuse users with unimportant and non-actionable error msg

Bug: b/310852966
Change-Id: I2c64a92a36b817043ff1f7abfa528d4c7aa449e8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5030272
Reviewed-by: Michael Savigny <msavigny@google.com>
Reviewed-by: Junji Watanabe <jwata@google.com>
Commit-Queue: Anas Sulaiman <mrahs@google.com>
changes/72/5030272/6
Anas Sulaiman 1 year ago committed by LUCI CQ
parent fba0ae4a38
commit 1e503bf950

@ -123,12 +123,11 @@ def auth_cache_status():
def get_hostname():
hostname = socket.gethostname()
# In case that returned an address, make a best effort attempt to get
# the hostname and ignore any errors.
try:
return socket.gethostbyaddr(hostname)[0]
except Exception as e:
print("socket.gethostbyaddr failed " +
"(falling back to socket.gethostname): %s" % e,
file=sys.stderr)
except Exception:
return hostname

Loading…
Cancel
Save