From f8b85bdbf3b1ee4ac1a80cd6da852d1a1ab1a2fe Mon Sep 17 00:00:00 2001 From: ThomasADavis Date: Fri, 16 Feb 2018 02:49:31 -0800 Subject: [PATCH] int("255.255.255.0" does not work, fixes issue #33867 (#36271) --- lib/ansible/modules/cloud/ovirt/ovirt_host_networks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_host_networks.py b/lib/ansible/modules/cloud/ovirt/ovirt_host_networks.py index a979dfb7df..0e40f69361 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_host_networks.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_host_networks.py @@ -180,7 +180,7 @@ class HostNetworksModule(BaseModule): if not equal(network.get('gateway'), ip.ip.gateway): ip.ip.gateway = network.get('gateway') changed = True - if not equal(network.get('prefix'), int(ip.ip.netmask) if ip.ip.netmask else None): + if not equal(network.get('prefix'), sum([bin(int(x)).count('1') for x in ip.ip.netmask.split('.')]) if ip.ip.netmask else None): ip.ip.netmask = str(network.get('prefix')) changed = True