def _check_existing_ip(self, ip, netboxid): msg = [] if does_ip_exist(ip, netboxid): msg.append("IP (%s) is already in database" % ip) if does_sysname_exist(self.sysname, netboxid): msg.append("Sysname (%s) is already in database" % self.sysname) if len(msg) > 0: raise IPExistsException(msg)
def _check_existing_ip(self, ip): msg = [] _, sysname = resolve_ip_and_sysname(ip) if does_ip_exist(ip, self.instance.pk): msg.append("IP (%s) is already in database" % ip) if does_sysname_exist(sysname, self.instance.pk): msg.append("Sysname (%s) is already in database" % sysname) if msg: raise IPExistsException(msg)