Skip to content

Commit f3ae303

Browse files
authored
Fall back to just hostname if hostname doesn't support -A (#900)
Only the Debian hostname program supports the -A option. Other ones like the net-tools and coreutils hostname programs don't.
1 parent ce97240 commit f3ae303

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/ood_core/job/adapters/linux_host/templates/script_wrapper.erb.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
SSH_HOSTS=(<%= ssh_hosts.join(' ').to_s %>)
3-
hostnames=`hostname -A`
3+
hostnames=`hostname -A 2>/dev/null || hostname`
44
for host in ${SSH_HOSTS[@]}
55
do
66
if [[ " ${hostnames[@]} " =~ " ${host} " ]]; then

lib/ood_core/job/adapters/systemd/templates/script_wrapper.erb.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
SSH_HOSTS=(<%= ssh_hosts.join(' ').to_s %>)
3-
hostnames=`hostname -A`
3+
hostnames=`hostname -A 2>/dev/null || hostname`
44
for host in ${SSH_HOSTS[@]}
55
do
66
if [[ " ${hostnames[@]} " =~ " ${host} " ]]; then

0 commit comments

Comments
 (0)