From patchwork Mon Oct 16 14:51:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kleber Sacilotto de Souza X-Patchwork-Id: 826326 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 3yG1Vx6NsHz9t3w; Tue, 17 Oct 2017 01:51:53 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1e46kA-0000oq-2D; Mon, 16 Oct 2017 14:51:50 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1e46k8-0000hx-2q for kernel-team@lists.ubuntu.com; Mon, 16 Oct 2017 14:51:48 +0000 Received: from mail-wm0-f71.google.com ([74.125.82.71]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1e46k7-00081B-Rv for kernel-team@lists.ubuntu.com; Mon, 16 Oct 2017 14:51:47 +0000 Received: by mail-wm0-f71.google.com with SMTP id b189so9599152wmd.9 for ; Mon, 16 Oct 2017 07:51:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=CONN9z1JfB0zP26sfQHgpKHsLwXNeGv/Y1uueC5zxl0=; b=p0SlSReHY9S83mJbmot1HCOwzu/jdH9bJf3dLrpWJFyd5Fu7WiS25L6bb8lQKxyZsZ GGMNv7JaF65kKMb/0CHgwO/FT6cO+UIuLko48iqK6peP8cIPZTDyZ3P29jcV4n1nHxBl GrmWC2vD50qDB+2ynGdLprzZ0VH/XRvJiWfDoBWRbVk1C+91SZMm2FWpwjRFxWPUGvsm su/3VfXjGiTr8K2Qc36o0U25X4Q/Mo/97RojcaoI+5iHPmrA46uJDi4bNwZwBoAfynRf O2Bc4aGdmIpy/XaVLPMUQpxJirK22BCMRA70gwMC+Hvb2XTNrFdBg4T2N7PReyKk1ftr Pjew== X-Gm-Message-State: AMCzsaVZ6CNNrkVUaXDG8tH/xthRkV/dAuv3tCZN5p8BYKkPycxYNp4R IxqFFoQ4FNHgfXu4iOKM6DlXFaK00YLE5rWcKto15e8yrzkB4lw+wGDWVTcV80iFKH6xhzA2tgd Kz+dWEx6Re0YSJMUL2TG95f5qcgZRnR4Ns+5Atoi9Dg== X-Received: by 10.28.29.205 with SMTP id d196mr1036317wmd.106.1508165507242; Mon, 16 Oct 2017 07:51:47 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TeBzRbyRaZssVM0b19D0ahdxUs/LDS2Xi4Tf9UkGPik1mUfCsdOdLtJvekZ5jY+s9kiOrqSw== X-Received: by 10.28.29.205 with SMTP id d196mr1036299wmd.106.1508165506958; Mon, 16 Oct 2017 07:51:46 -0700 (PDT) Received: from localhost ([2a02:8109:a540:7e8:55a9:d0f9:3b71:8025]) by smtp.gmail.com with ESMTPSA id 19sm6701293wms.7.2017.10.16.07.51.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Oct 2017 07:51:46 -0700 (PDT) From: Kleber Sacilotto de Souza To: kernel-team@lists.ubuntu.com Subject: [PATCH][kteam-tools] ktl/tracking_bug.py: fix snap tasks lookup Date: Mon, 16 Oct 2017 16:51:44 +0200 Message-Id: <20171016145144.9584-1-kleber.souza@canonical.com> X-Mailer: git-send-email 2.14.1 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" The layout of the snap-related information has been changed on kernel-series-info.yaml. So change ktl/tracking_bug.py for the new layout. Signed-off-by: Kleber Sacilotto de Souza --- ktl/tracking_bug.py | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/ktl/tracking_bug.py b/ktl/tracking_bug.py index 426d39b0..8ce69170 100644 --- a/ktl/tracking_bug.py +++ b/ktl/tracking_bug.py @@ -16,6 +16,7 @@ class TrackingBug: self.wf = Workflow() self.ub = Ubuntu() self.__dependency_list = None + self.__dependency_snaps = None self._targeted_series_name = None self._series_specified = None self._series_target = None @@ -40,6 +41,27 @@ class TrackingBug: retval = dependent_package in self.__dependency_list return retval + # get_dependent_snap + def get_dependent_snap(self, series, main_package): + ''' + Return the name of the dependent snap for the specified series/package. + Return None if not found. + ''' + if self.__dependency_snaps is None: + try: + record = self.ub.lookup(series) + try: + self.__dependency_snaps = record['dependent-snaps'][main_package] + except KeyboardInterrupt: + self.__dependency_snaps = {} + except KeyError: + self.__dependency_snaps = {} + + try: + return self.__dependency_snaps['snap'] + except KeyError: + return None + # valid_series # def valid_series(s, lp_series, series_specified, targeted_series_name, package): @@ -64,7 +86,7 @@ class TrackingBug: if lp_series.name == 'prepare-package-signed' and not s.has_dependent_package(targeted_series_name, package, 'signed'): cdebug(' no prepare-package-signed', 'yellow') break - if not s.has_dependent_package(targeted_series_name, package, 'snap'): + if s.get_dependent_snap(targeted_series_name, package) is None: if lp_series.name == 'snap-release-to-edge': cdebug(' no snap-release-to-edge', 'yellow') break