'Syncs the current configuration file with the config tree.
Using the Check().run_ functions previously is recommended'

def run(self):

    if (not os.path.exists(self.bootloc)):
        utils.die(self.logger, ('cannot    find    directory:    %s' % self.bootloc))
    self.logger.info('running    pre-sync    triggers')
    utils.run_triggers(self.api, None, '/var/lib/cobbler/triggers/sync/pre/*')
    self.distros = self.collection_mgr.distros()
    self.profiles = self.collection_mgr.profiles()
    self.systems = self.collection_mgr.systems()
    self.settings = self.collection_mgr.settings()
    self.repos = self.collection_mgr.repos()
    self.logger.info('cleaning    trees')
    self.clean_trees()
    self.tftpd.sync(self.verbose)
    for d in self.distros:
        try:
            self.logger.info(('copying    files    for    distro:    %s' % d.name))
            self.tftpgen.copy_single_distro_files(d, self.settings.webdir, True)
            self.tftpgen.write_templates(d, write_file=True)
        except CX as e:
            self.logger.error(e.value)
    self.tftpgen.make_pxe_menu()
    if self.settings.manage_dhcp:
        self.write_dhcp()
    if self.settings.manage_dns:
        self.logger.info('rendering    DNS    files')
        self.dns.regen_hosts()
        self.dns.write_dns_files()
    if self.settings.manage_tftpd:
        self.logger.info('rendering    TFTPD    files')
        self.tftpd.write_tftpd_files()
        self.tftpd.write_boot_files()
    self.logger.info('cleaning    link    caches')
    self.clean_link_cache()
    if self.settings.manage_rsync:
        self.logger.info('rendering    Rsync    files')
        self.rsync_gen()
    self.logger.info('running    post-sync    triggers')
    utils.run_triggers(self.api, None, '/var/lib/cobbler/triggers/sync/post/*', logger=self.logger)
    utils.run_triggers(self.api, None, '/var/lib/cobbler/triggers/change/*', logger=self.logger)
