예제 #1
0
 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)
예제 #2
0
파일: forms.py 프로젝트: Cloudxtreme/nav
 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)
예제 #3
0
 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)