'Copy bootloaders to the configured tftpboot directory
NOTE: we support different arch\'s if defined in
/etc/cobbler/settings.'

def copy_bootloaders(self):

    dst = self.bootloc
    grub_dst = os.path.join(dst, 'grub')
    boot_dst = os.path.join(dst, 'boot/grub')
    try:
        try:
            utils.copyfile_pattern('/var/lib/cobbler/loaders/pxelinux.0', dst, api=self.api, cache=False, logger=self.logger)
            utils.copyfile_pattern('/var/lib/cobbler/loaders/menu.c32', dst, api=self.api, cache=False, logger=self.logger)
        except:
            utils.copyfile_pattern('/usr/share/syslinux/pxelinux.0', dst, api=self.api, cache=False, logger=self.logger)
            utils.copyfile_pattern('/usr/share/syslinux/menu.c32', dst, api=self.api, cache=False, logger=self.logger)
    except:
        utils.copyfile_pattern('/usr/lib/syslinux/pxelinux.0', dst, api=self.api, cache=False, logger=self.logger)
        utils.copyfile_pattern('/usr/lib/syslinux/menu.c32', dst, api=self.api, cache=False, logger=self.logger)
    utils.copyfile_pattern('/var/lib/cobbler/loaders/yaboot', dst, require_match=False, api=self.api, cache=False, logger=self.logger)
    utils.copyfile_pattern('/var/lib/cobbler/loaders/boot/grub/*', boot_dst, require_match=False, api=self.api, cache=False, logger=self.logger)
    try:
        utils.copyfile_pattern('/usr/lib/syslinux/memdisk', dst, api=self.api, cache=False, logger=self.logger)
    except:
        utils.copyfile_pattern('/usr/share/syslinux/memdisk', dst, require_match=False, api=self.api, cache=False, logger=self.logger)
    utils.copyfile_pattern('/usr/share/*pxe/undionly.kpxe', dst, require_match=False, api=self.api, cache=False, logger=self.logger)
    utils.copyfile_pattern('/var/lib/cobbler/loaders/grub*.efi', grub_dst, require_match=False, api=self.api, cache=False, logger=self.logger)
    pxegrub_imported = False
    for i in self.distros:
        if (('nexenta' == i.breed) and (not pxegrub_imported)):
            if os.path.isdir(os.path.join(self.bootloc, 'boot')):
                shutil.rmtree(os.path.join(self.bootloc, 'boot'))
            shutil.copytree(os.path.join('/var', 'www', 'cobbler', 'distro_mirror', i.name, 'boot'), os.path.join(self.bootloc, 'boot'))
            pxegrub_imported = True
