diff options
-rw-r--r-- | apex/virtual/virtual_utils.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/apex/virtual/virtual_utils.py b/apex/virtual/virtual_utils.py index 4582dbc7..255d2c69 100644 --- a/apex/virtual/virtual_utils.py +++ b/apex/virtual/virtual_utils.py @@ -92,8 +92,11 @@ def host_setup(node): libvirt_sasl_username=False) # TODO(trozet): add support for firewalld - subprocess.call(['systemctl', 'stop', 'firewalld']) - + try: + subprocess.check_call(['systemctl', 'stop', 'firewalld']) + subprocess.check_call(['systemctl', 'restart', 'libvirtd']) + except subprocess.CalledProcessError: + logging.warning('Failed to stop firewalld and restart libvirtd') # iptables rule rule = iptc.Rule() rule.protocol = 'udp' |