Exemple #1
0
 def to_file(self, zone_name, file, records_dict=None):
     '''Export zone to file
     
     '''
     try:
         if not records_dict:
             records_dict = self.list_records(zone_name, True)
         if records_dict:
             zh = ZoneHandle(zone_name)
             zh.from_records_dict(records_dict)
             zh.to_file(file)
     except Exception, e:
         if self.debug: print e
         raise e
Exemple #2
0
 def to_file(self, zone_name, file, records_dict=None):
     '''Export zone to file
     
     '''
     try:
         if not records_dict:
             records_dict = self.list_records(zone_name, True)
         if records_dict:
             zh = ZoneHandle(zone_name)
             zh.from_records_dict(records_dict)
             zh.to_file(file)
     except Exception, e:
         if self.debug: print e
         raise e
Exemple #3
0
 def import_zone(self, zone_name, method, param=None, dryrun=False):
     '''Import zone 
     methods are AXFR, FILE, TEXT, DICT and GUESS
     
     '''
     zh = ZoneHandle(zone_name)
     try:
         if method==ZoneHandle.IMPORT_AXFR:
             zh.from_axfr(param)
         elif method==ZoneHandle.IMPORT_FILE: 
             zh.from_file(param)
         elif method==ZoneHandle.IMPORT_TEXT:
             zh.from_text(param)
         elif method==ZoneHandle.IMPORT_DICT:
             zh.from_records_dict(param)
         elif method==ZoneHandle.IMPORT_GUESS:
             zh.from_guessing(param)
             
     except Exception, e:
             if self.debug: print e
             raise e
Exemple #4
0
    def import_zone(self, zone_name, method, param=None, dryrun=False):
        '''Import zone 
        methods are AXFR, FILE, TEXT, DICT and GUESS
        
        '''
        zh = ZoneHandle(zone_name)
        try:
            if method == ZoneHandle.IMPORT_AXFR:
                zh.from_axfr(param)
            elif method == ZoneHandle.IMPORT_FILE:
                zh.from_file(param)
            elif method == ZoneHandle.IMPORT_TEXT:
                zh.from_text(param)
            elif method == ZoneHandle.IMPORT_DICT:
                zh.from_records_dict(param)
            elif method == ZoneHandle.IMPORT_GUESS:
                zh.from_guessing(param)

        except Exception, e:
            if self.debug: print e
            raise e