summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/host_name.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/conf_mode/host_name.py b/src/conf_mode/host_name.py
index 0d03fd41c..13b2b98ae 100755
--- a/src/conf_mode/host_name.py
+++ b/src/conf_mode/host_name.py
@@ -25,6 +25,7 @@ import re
import sys
import copy
import glob
+import subprocess
import argparse
import jinja2
@@ -250,13 +251,13 @@ def apply(config):
# rsyslog runs into a race condition at boot time with systemd
# restart rsyslog only if the hostname changed.
- hn = subprocess.check_output(['hostnamectl','--static']).decode().strip()
+ hn = subprocess.check_output(['hostnamectl', '--static']).decode().strip()
os.system("hostnamectl set-hostname --static {0}".format(fqdn.rstrip('.')))
# Restart services that use the hostname
if hn != fqdn:
- os.system("systemctl restart rsyslog.service")
+ os.system("systemctl restart rsyslog.service")
# If SNMP is running, restart it too
if os.system("pgrep snmpd > /dev/null") == 0: