summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKim <kim.sidney@gmail.com>2019-06-18 16:10:12 +0200
committerGitHub <noreply@github.com>2019-06-18 16:10:12 +0200
commita7e834b27044e7bfdd770d38813d2c6c77539c7f (patch)
tree4093cb0095db8c6ea5c3497094b110ca37e6b508 /src
parent73021645d1d1fa0e851bae7e003982f9ee491e84 (diff)
parent0037287a8e6a7ddd6d4a8101804d9cc0b8b3e70f (diff)
downloadvyos-1x-a7e834b27044e7bfdd770d38813d2c6c77539c7f.tar.gz
vyos-1x-a7e834b27044e7bfdd770d38813d2c6c77539c7f.zip
Merge pull request #73 from UnicronNL/current
[ config ] T1447: Python subprocess called without import in host_nam…
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: