+ if isinstance(network, basestring):
+ address = {"address": [{"ip": ip_addr, "netmask": network}, ]}
+ elif isinstance(network, int) and (0 < network < 33):
+ address = {"address": [{"ip": ip_addr, "prefix-length": network}, ]}
+ else:
+ raise HoneycombError("Value {0} is not a valid netmask or network "
+ "prefix length.".format(network))