Restarts libvirtd after stopping firewalld
[apex.git] / apex / virtual / virtual_utils.py
index 4582dbc..255d2c6 100644 (file)
@@ -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'