Ejemplo n.º 1
0
def preview(request):
    from xbaydnsweb import conftoresults
    try:
        conftoresults.main(preview=True)
    except:
        pass
    return HttpResponseRedirect('/web/previewarea/')
Ejemplo n.º 2
0
 def delete(self):
     from xbaydnsweb.web.utils import *
     if len(Record.objects.filter(record_type__record_type='NS',domain=self.domain))==1 and self.record_type.record_type == "NS":
         return
     self.viewname="view_viewdefault"
     record_delete(self)
     if len(Result.objects.filter(idc__alias=self.idc.alias)) != 0:
         if len(Record.objects.filter(name=self.name,domain=self.domain,idc=self.idc))==1:
             super(Record,self).delete()
             for iparea in IPArea.objects.all():
                 if ("%s.%s"%(self.name,self.domain),self.idc.alias) in list(eval(iparea.service_route)):
                     self.viewname = iparea.view
                     record_delete(self)
             conftoresults.main()
             saveAllConf()
             return
         else:
             for iparea in IPArea.objects.all():
                 if ("%s.%s"%(self.name,self.domain),self.idc.alias) in list(eval(iparea.service_route)):
                     self.viewname = iparea.view
                     record_delete(self)
     else:
         for iparea in IPArea.objects.all():
             self.viewname = iparea.view
             record_delete(self)
     super(Record,self).delete()
Ejemplo n.º 3
0
def preview(request):
    from xbaydnsweb import conftoresults

    try:
        conftoresults.main(preview=True)
    except:
        pass
    return HttpResponseRedirect("/web/previewarea/")
Ejemplo n.º 4
0
def loadgenview(request):
    from xbaydns.conf import sysconf
    from xbaydnsweb import conftoresults
    try:
        conftoresults.main()
        saveAllConf()
    except:
        pass
    return HttpResponseRedirect('/web/iparea/')
Ejemplo n.º 5
0
def loadgenview(request):
    from xbaydns.conf import sysconf
    from xbaydnsweb import conftoresults

    try:
        conftoresults.main()
        saveAllConf()
    except:
        pass
    return HttpResponseRedirect("/web/iparea/")
Ejemplo n.º 6
0
 def save(self):
     from xbaydnsweb.web.utils import *
     from xbaydns.conf import sysconf
     old_record = None
     if self.id != None:
         old_record = copy.deepcopy(Record.objects.get(id=self.id))
     super(Record,self).save()
     try:
         self.viewname="view_viewdefault"
         if old_record !=None:
             old_record.viewname = "view_viewdefault"
             record_delete(old_record)
         record_nsupdate(self)
         if self.record_type.record_type == 'A' and self.idc != None:
             if self.idc.alias not in getDetectedIDC():
                 for iparea in IPArea.objects.all():
                     self.viewname = iparea.view
                     if old_record !=None:
                         old_record.viewname = iparea.view
                         record_delete(old_record)
                     record_nsupdate(self)
             else:
                 if len(Record.objects.filter(idc=self.idc,record_type__record_type='A')) == 1:
                     conftoresults.main()
                     saveAllConf()
                 else:
                     if len(Record.objects.filter(name=self.name,domain=self.domain,idc=self.idc))==1:
                         conftoresults.main()
                         saveAllConf()
                     else:
                         for iparea in IPArea.objects.all():
                             if ("%s.%s"%(self.name,self.domain),self.idc.alias) in list(eval(iparea.service_route)):
                                 self.viewname = iparea.view
                                 if old_record !=None:
                                     old_record.viewname = iparea.view
                                     record_delete(old_record)
                                 record_nsupdate(self)
         else:
             for iparea in IPArea.objects.all():
                 self.viewname = iparea.view
                 if old_record !=None:
                     old_record.viewname = iparea.view
                     record_delete(old_record)
                 record_nsupdate(self)
     except:
         if self.id != None:
             super(Record,self).delete()
         print traceback.print_exc()