Esempio n. 1
0
    def run(self):
        provName = self.get_option('name')
        orgName  = self.get_option('org')

        prov = get_provider(orgName, provName)

        task = ManifestAsyncTask(self.api.refresh_manifest(prov["id"]))
        run_spinner_in_bg(wait_for_async_task, [task], message=_("Refreshing manifest, please wait... "))

        return ManifestAsyncTask.evaluate_task_status(task,
            failed =   _("Provider [ %s ] failed to refresh manifest") % provName,
            canceled = _("Provider [ %s ] canceled manifest refresh") % provName,
            ok =       _("Provider [ %s ] manifest refresh complete") % provName
        )
Esempio n. 2
0
    def run(self):
        provName = self.get_option('name')
        orgName = self.get_option('org')

        prov = get_provider(orgName, provName)

        task = ManifestAsyncTask(self.api.refresh_manifest(prov["id"]))
        run_spinner_in_bg(wait_for_async_task, [task],
                          message=_("Refreshing manifest, please wait... "))

        return ManifestAsyncTask.evaluate_task_status(
            task,
            failed=_("Provider [ %s ] failed to refresh manifest") % provName,
            canceled=_("Provider [ %s ] canceled manifest refresh") % provName,
            ok=_("Provider [ %s ] manifest refresh complete") % provName)
Esempio n. 3
0
    def run(self):
        provName = self.get_option('name')
        orgName  = self.get_option('org')
        manifestPath = self.get_option('file')
        force = self.get_option('force')

        try:
            f = open(get_abs_path(manifestPath))
        except IOError:
            system_exit(os.EX_IOERR, _("File %s does not exist") % manifestPath)

        prov = get_provider(orgName, provName)

        task = ManifestAsyncTask(self.api.import_manifest(prov["id"], f, force))
        run_spinner_in_bg(wait_for_async_task, [task], message=_("Importing manifest, please wait... "))

        return ManifestAsyncTask.evaluate_task_status(task,
            failed =   _("Provider [ %s ] failed to import manifest") % provName,
            canceled = _("Provider [ %s ] canceled manifest import") % provName,
            ok =       _("Provider [ %s ] manifest import complete") % provName
        )
Esempio n. 4
0
    def run(self):
        provName = self.get_option('name')
        orgName = self.get_option('org')
        manifestPath = self.get_option('file')
        force = self.get_option('force')

        try:
            f = open(get_abs_path(manifestPath))
        except IOError:
            system_exit(os.EX_IOERR,
                        _("File %s does not exist") % manifestPath)

        prov = get_provider(orgName, provName)

        task = ManifestAsyncTask(self.api.import_manifest(
            prov["id"], f, force))
        run_spinner_in_bg(wait_for_async_task, [task],
                          message=_("Importing manifest, please wait... "))

        return ManifestAsyncTask.evaluate_task_status(
            task,
            failed=_("Provider [ %s ] failed to import manifest") % provName,
            canceled=_("Provider [ %s ] canceled manifest import") % provName,
            ok=_("Provider [ %s ] manifest import complete") % provName)