Skip to content

Commit 0679d4a

Browse files
Return /etc/hostname when 'hostname' command does not exist
In the Trilinos clang container, the command 'hostname' does not exist but the file /etc/hostname does exist.
1 parent bef4ccf commit 0679d4a

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

tribits/ci_support/CheckinTest.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,17 @@ def getExtraCommandOutputFileName():
158158

159159

160160
def getHostname():
161-
return getCmndOutput("hostname", True)
161+
hostname = ""
162+
try:
163+
hostname = getCmndOutput("hostname", True)
164+
except Exception:
165+
pass
166+
if hostname == "":
167+
try:
168+
hostname = getCmndOutput("cat /etc/hostname", True)
169+
except Exception:
170+
pass
171+
return hostname
162172

163173

164174
def getEmailAddressesSpaceString(emailAddressesCommasStr):

0 commit comments

Comments
 (0)