当前位置: 首页>>代码示例>>Python>>正文


Python AsyncTask.errors方法代码示例

本文整理汇总了Python中katello.client.core.utils.AsyncTask.errors方法的典型用法代码示例。如果您正苦于以下问题:Python AsyncTask.errors方法的具体用法?Python AsyncTask.errors怎么用?Python AsyncTask.errors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在katello.client.core.utils.AsyncTask的用法示例。


在下文中一共展示了AsyncTask.errors方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: run

# 需要导入模块: from katello.client.core.utils import AsyncTask [as 别名]
# 或者: from katello.client.core.utils.AsyncTask import errors [as 别名]
    def run(self):
        orgName     = self.get_option('org')
        prodName    = self.get_option('name')
        prodLabel   = self.get_option('label')
        prodId      = self.get_option('id')
        envName     = self.get_option('environment')

        env = get_environment(orgName, envName)
        prod = get_product(orgName, prodName, prodLabel, prodId)

        returnCode = os.EX_OK

        cset = self.csapi.create(orgName, env["id"], self.create_cs_name(), constants.PROMOTION)
        try:
            self.csapi.add_content(cset["id"], "products", {'product_id': prod['id']})
            task = self.csapi.apply(cset["id"])
            task = AsyncTask(task)

            run_spinner_in_bg(wait_for_async_task, [task], message=_("Promoting the product, please wait... "))

            if task.succeeded():
                print _("Product [ %(prod_name)s ] promoted to environment [ %(envName)s ] " \
                    % {'prod_name':prod["name"], 'envName':envName})
                returnCode = os.EX_OK
            else:
                print _("Product [ %(prod_name)s ] promotion failed: %(task_errors)s" \
                    % {'prod_name':prod["name"], 'task_errors':format_task_errors(task.errors())} )
                returnCode = os.EX_DATAERR

        except Exception:
            #exception message is printed from action's main method
            raise

        return returnCode
开发者ID:chiehwen,项目名称:katello,代码行数:36,代码来源:product.py

示例2: run

# 需要导入模块: from katello.client.core.utils import AsyncTask [as 别名]
# 或者: from katello.client.core.utils.AsyncTask import errors [as 别名]
    def run(self):
        name = self.get_option('name')

        task = self.api.delete(name)
        task = AsyncTask(task)

        run_spinner_in_bg(wait_for_async_task, [task], message=_("Deleting the organization, please wait... "))

        if task.succeeded():
            print _("Successfully deleted org [ %s ]") % name
            return os.EX_OK
        else:
            print _("Organization [ %(name)s ] deletion failed: %(format_task_errors)s" \
                % {'name':name, 'format_task_errors':format_task_errors(task.errors())} )
            return os.EX_DATAERR
开发者ID:chiehwen,项目名称:katello,代码行数:17,代码来源:organization.py

示例3: run

# 需要导入模块: from katello.client.core.utils import AsyncTask [as 别名]
# 或者: from katello.client.core.utils.AsyncTask import errors [as 别名]
    def run(self):
        csName = self.get_option('name')
        orgName = self.get_option('org')
        envName = self.get_option('environment')

        cset = get_changeset(orgName, envName, csName)

        task = self.api.apply(cset["id"])
        task = AsyncTask(task)

        run_spinner_in_bg(wait_for_async_task, [task], message=_("Applying the changeset, please wait... "))

        if task.succeeded():
            print _("Changeset [ %s ] applied" % csName)
            return os.EX_OK
        else:
            print _("Changeset [ %(csName)s ] promotion failed: %(task_errors)s" \
                % {'csName':csName, 'task_errors':format_task_errors(task.errors())})
            return os.EX_DATAERR
开发者ID:chiehwen,项目名称:katello,代码行数:21,代码来源:changeset.py

示例4: run

# 需要导入模块: from katello.client.core.utils import AsyncTask [as 别名]
# 或者: from katello.client.core.utils.AsyncTask import errors [as 别名]
    def run(self):
        csName = self.get_option('name')
        orgName = self.get_option('org')
        envName = self.get_option('env')

        cset = get_changeset(orgName, envName, csName)
        if cset == None:
            return os.EX_DATAERR

        task = self.api.promote(cset["id"])
        task = AsyncTask(task)

        run_spinner_in_bg(wait_for_async_task, [task], message=_("Promoting the changeset, please wait... "))

        if task.succeeded():
            print _("Changeset [ %s ] promoted" % csName)
            return os.EX_OK
        else:
            print _("Changeset [ %s ] promotion failed: %s" % (csName, format_task_errors(task.errors())))
            return os.EX_DATAERR
开发者ID:jsomara,项目名称:katello,代码行数:22,代码来源:changeset.py

示例5: run

# 需要导入模块: from katello.client.core.utils import AsyncTask [as 别名]
# 或者: from katello.client.core.utils.AsyncTask import errors [as 别名]
    def run(self):
        orgName     = self.get_option('org')
        prodName    = self.get_option('name')
        envName     = self.get_option('env')

        env = get_environment(orgName, envName)
        prod = get_product(orgName, prodName)

        returnCode = os.EX_OK

        cset = self.csapi.create(orgName, env["id"], self.create_cs_name())
        try:
            self.csapi.add_content(cset["id"], "products", {'product_id': prod['id']})
            task = self.csapi.promote(cset["id"])
            task = AsyncTask(task)

            run_spinner_in_bg(wait_for_async_task, [task], message=_("Promoting the product, please wait... "))

            if task.succeeded():
                print _("Product [ %s ] promoted to environment [ %s ] " % (prodName, envName))
                returnCode = os.EX_OK
            else:
                print _("Product [ %s ] promotion failed: %s" % (prodName, format_task_errors(task.errors())) )
                returnCode = os.EX_DATAERR

        except Exception as e:
            #exception message is printed from action's main method
            raise e

        return returnCode
开发者ID:skottler,项目名称:katello,代码行数:32,代码来源:product.py


注:本文中的katello.client.core.utils.AsyncTask.errors方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。