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


Python BuildService.deletePackage方法代码示例

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


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

示例1: ParticipantHandler

# 需要导入模块: from buildservice import BuildService [as 别名]
# 或者: from buildservice.BuildService import deletePackage [as 别名]
class ParticipantHandler(object):
    """Participant class as defined by the SkyNET API."""

    def __init__(self):
        self.oscrc = None
        self.obs = None

    def handle_wi_control(self, ctrl):
        """Job control thread."""
        pass

    def handle_lifecycle_control(self, ctrl):
        """Participant control thread."""
        if ctrl.message == "start":
            if ctrl.config.has_option("obs", "oscrc"):
                self.oscrc = ctrl.config.get("obs", "oscrc")

    def setup_obs(self, namespace):
        """Setup the Buildservice instance

        Using the namespace as an alias to the apiurl.
        """
        self.obs = BuildService(oscrc=self.oscrc, apiurl=namespace)

    def revert_trial(self, wid):
        """Copy packages from trunk to testing.

          * The revert notes the intended request destination and copies the
            latest version from there (usually Trunk) back into the build_in
            project.
          * Later, if/when parallel build_in projects are used it may be
            important to correctly sync build_in from a potentially updated
            Trunk
          * If build_in is a project link we remove the packages and
            wipebinaries
        """

        wid.result = False
        rid = wid.fields.ev.id
        actions = wid.fields.ev.actions
        build_in = wid.params.build_in

        for act in actions:
            if act['type'] != 'submit':
                continue
            if wid.params.linked :
                self.obs.deletePackage(build_in, act['targetpackage'])
                # wipeBinaries errors if there are no packages to wipe
                if self.obs.getPackageList(build_in):
                    self.obs.wipeBinaries(build_in)
            else:
                try:
                    self.obs.copyPackage(self.obs.apiurl,
                                         act['targetproject'],
                                         act['targetpackage'],
                                         self.obs.apiurl,
                                         build_in,
                                         act['targetpackage'],
                                         client_side_copy = False,
                                         keep_maintainers = False,
                                         keep_develproject = False,
                                         expand = False,
                                         comment = "Trial revert for \
                                                    request %s" % rid)
                except HTTPError, exp:
                    # If the package is not found in target, reverting is
                    # done by deleting it from build_in.
                    if exp.code == 404:
                        self.obs.deletePackage(build_in,
                                               act['targetpackage'])
                else:
                    raise
开发者ID:MeeGoIntegration,项目名称:boss-standard-workflow,代码行数:74,代码来源:do_revert_trial.py


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