X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FIPUtil.py;h=e364e60ceeb4a3cc7fc9103c283b7d50035f390c;hp=4b6e2766d892f0c9554da86954ddebad455c7a00;hb=fdc6e0fc0c675eb4faa699fef7e1e2ca91df2b03;hpb=f94e16167519c74707ec8b606da3f7b97c749c66 diff --git a/resources/libraries/python/IPUtil.py b/resources/libraries/python/IPUtil.py index 4b6e2766d8..e364e60cee 100644 --- a/resources/libraries/python/IPUtil.py +++ b/resources/libraries/python/IPUtil.py @@ -56,9 +56,9 @@ def convert_ipv4_netmask_prefix(network): net = IPv4Network(u"{0}/{1}".format(temp_address, network), False) if isinstance(network, int) and (0 < network < 33): - return net.netmask + return str(net.netmask) elif isinstance(network, basestring): - return net.prefixlen + return int(net.prefixlen) else: raise Exception("Value {0} is not a valid ipv4 netmask or network" " prefix length".format(network))