When stopping firewalld, libvirtd needs to be restarted in order for
libvirt to use/populate iptables with the NAT rules for the default
virsh network.
JIRA: APEX-510
Change-Id: Ia5b4515fd961baa70de58814e9eae4b397db28a7
Signed-off-by: Tim Rozet <trozet@redhat.com>
libvirt_sasl_username=False)
# TODO(trozet): add support for firewalld
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'
# iptables rule
rule = iptc.Rule()
rule.protocol = 'udp'