diff --git a/rc/control/utilities.py b/rc/control/utilities.py index e30e9a9d..52b5f32c 100755 --- a/rc/control/utilities.py +++ b/rc/control/utilities.py @@ -909,17 +909,8 @@ def record_directory_info(recorddir): def get_short_hostname(): - hostname = ( - Popen( - "hostname -s", - executable="/bin/bash", - shell=True, - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT, encoding="UTF-8" - ) - .stdout.readlines()[0] - .strip() - ) + import socket + hostname = socket.gethostname().split('.', 1)[0] return hostname