This module contains all of the logic for the recovery system.
It should be only called by the roster recovery system.
Bases: object
Roster Recovery
This class contains methods pertaining to recover roster after catastrophic failure.
Restores database from sql backup with specified audit log id
This module is used for exporting data in the database for all hosts to a BIND readable text form.
Bases: object
This class exports zones
Adds file string to tarfile object
Cooks data for zone exporter
dict: dictionary keyed by dns_server_set ex: {u’external_dns’: {
- ‘dns_servers’: [u’[ns1.university.edu]’, u’[dns2.university.edu]’,
- u’[dns3.university.edu]’],
- ‘views’: {u’external’:
- {u’university.edu’: {‘records’:
- [{u’serial_number’: 20091227, u’refresh_seconds’: 5,
‘target’: u’university.edu.’, u’name_server’: u’ns1.university.edu.’, u’retry_seconds’: 5, ‘ttl’: 3600, u’minimum_seconds’: 5, ‘record_type’: u’soa’, ‘view_name’: u’external’, ‘last_user’: u’sharrell’, ‘zone_name’: u’university.edu’, u’admin_email’: u'admin@university.edu.’, u’expiry_seconds’: 5},
- {‘target’: u’computer1’, ‘ttl’: 3600, ‘record_type’: u’a’,
- ‘view_name’: u’external’, ‘last_user’: u’sharrell’, ‘zone_name’: u’university.edu’, u’assignment_ip’: u‘1.2.3.5’}, ‘zone_origin’: u’example.’, ‘zone_type’: u’master’}}}}}
This takes raw data from the database and turns it into a mysqldump-like output.
Exports bind trees to files
Gets raw data from database
- Outputs:
- tuple of two dictionaries:
- dictionary of raw data keyed by data name with values of dicts
- containing values of that type’s attributes
- dictionary of the raw dump keyed by data name with values of
- dicts containing the db dump keyed by row, column, and schema
- example:
- ({‘view_acl_assignments’: ({
- ‘view_acl_assignments_view_name’: u’external’, ‘view_acl_assignments_acl_name’: u’public’, ‘view_acl_assignments_acl_range_allowed’: 1})},
- { u’zones’:
- {‘rows’:[{}],
‘columns’: [u’zones_id’, u’zone_name’], ‘schema’:(
u’CREATE TABLE zones (
- zones_id mediumint(8) ‘,
- ‘unsigned NOT NULL auto_increment,
- zone_name varchar(255) ‘,
- ‘NOT NULL,
PRIMARY KEY (zones_id), UNIQUE KEY ;
‘zone_name (zone_name),
- KEY zone_name_1 ‘
- ‘(zone_name)
Lists acl names
Lists latest named.conf global options
This function is duplicated in roster-core/roster_core/core_helpers.py
Lists record argument definitions given table from database
This function is duplicated in roster-core/roster_core/core.py
of lists of record arguments sorted by argument order. example: {‘mx’: [{‘argument_name’: u’priority’,
‘record_arguments_type’: u’mx’, ‘argument_data_type’: u’UnsignedInt’, ‘argument_order’: 0},
- {‘argument_name’: u’mail_server’,
- ‘record_arguments_type’: u’mx’, ‘argument_data_type’: u’Hostname’, ‘argument_order’: 1}]}
Makes named.conf file strings
Adds/Changes directory in named.conf header
Sorts records for zone exporter
dict: dictionary keyed by tuple (zone, view_dep) ex: {(u’university.edu’, u’internal_dep’):
- {11: {‘target’: u’computer4’, ‘ttl’: 3600, ‘record_type’: u’a’,
‘view_name’: u’internal’, ‘last_user’: u’sharrell’, ‘zone_name’: u’university.edu’, u’assignment_ip’: u‘192.168.1.4’},
- 12: {u’serial_number’: 20091225, u’refresh_seconds’: 5,
- ‘target’: u’university.edu.’, u’name_server’: u’ns1.university.edu.’, u’retry_seconds’: 5, ‘ttl’: 3600, u’minimum_seconds’: 5, ‘record_type’: u’soa’, ‘view_name’: u’internal’, ‘last_user’: u’sharrell’, ‘zone_name’: u’university.edu’, u’admin_email’: u'admin@university.edu.’, u’expiry_seconds’: 5}}}
This module contains all of the logic for the zone exporter.
It should be only called by the exporter.
Bases: roster_core.errors.CoreError
Gets the records from the db and sorts them.
Makes zone string that can be written to a file. Inputs:
records: dictionary of sorted records zone_origin: string of zone origin argument_definitions: dictionary of argument definitions zone_name: string of zone name view_name: string of view name
This module contains all of the logic for the zone importer.
It should be only called by the importer.
Bases: object
This class will only import one zone per init. It will load the zone from a file using dns.zone and then use the core API to put it in the database.