From 0037287a8e6a7ddd6d4a8101804d9cc0b8b3e70f Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Tue, 18 Jun 2019 16:08:08 +0200 Subject: [ config ] T1447: Python subprocess called without import in host_name.py --- src/conf_mode/host_name.py | 5 +++-- 1 file 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: -- cgit v1.2.3