'Generates an ISO in /var/www/cobbler/pub that can be used to install
profiles without using PXE.'

def background_buildiso(self, options, token):

    webdir = '/var/www/cobbler/'
    if os.path.exists('/srv/www'):
        webdir = '/srv/www/cobbler/'
    def runner(self):
        self.remote.api.build_iso(self.options.get('iso', (webdir + '/pub/generated.iso')), self.options.get('profiles', None), self.options.get('systems', None), self.options.get('buildisodir', None), self.options.get('distro', None), self.options.get('standalone', False), self.options.get('airgapped', False), self.options.get('source', None), self.options.get('exclude_dns', False), self.options.get('mkisofs_opts', None), self.logger)
    def on_done(self):
        if (self.options.get('iso', '') == (webdir + '/pub/generated.iso')):
            msg = 'ISO    now    available    for    <A    HREF="/cobbler/pub/generated.iso">download</A>'
            self.remote._new_event(msg)
    return self.__start_task(runner, token, 'buildiso', 'Build    Iso', options, on_done)
