From cb998d3b3fffcd371f93d49f31ddb7f0d6080825 Mon Sep 17 00:00:00 2001 From: Sayan Chowdhury Date: Oct 28 2016 04:07:48 +0000 Subject: Remove the compose date to avoid duplication --- diff --git a/bugyou_plugins/plugins/autocloud/plugin.py b/bugyou_plugins/plugins/autocloud/plugin.py index 0a6fefe..53b3dfc 100644 --- a/bugyou_plugins/plugins/autocloud/plugin.py +++ b/bugyou_plugins/plugins/autocloud/plugin.py @@ -17,6 +17,8 @@ # Authors: Sayan Chowdhury # +import re + from bugyou_plugins.plugins.base import BasePlugin from bugyou_plugins.services.pagure import PagureService @@ -60,8 +62,12 @@ class AutocloudPlugin(BasePlugin): job_id = msg_info['job_id'] compose_id = msg_info['compose_id'] - lookup_key = lookup_key_tmpl.format(image_name=image_name, - release=release) + # Generalize image_name here. The image_name contains the compose date + # and the respin. The regex is to remove those. + pattern = '[-]\d{8}(.n)?.\d' + formatted_image_name = re.sub(pattern, '', image_name) + lookup_key = lookup_key_tmpl.format(image_name=formatted_image_name, + release=release) lookup_key_exists = lookup_key in issue_titles diff --git a/bugyou_plugins/services/pagure/__init__.py b/bugyou_plugins/services/pagure/__init__.py index e0c1ab4..3410f4b 100644 --- a/bugyou_plugins/services/pagure/__init__.py +++ b/bugyou_plugins/services/pagure/__init__.py @@ -39,8 +39,7 @@ class PagureService(BaseService): 'access_token') self.project = libpagure.Pagure(pagure_token=self.access_token, - pagure_repository=self.repo_name, - instance_url="https://stg.pagure.io") + pagure_repository=self.repo_name) def get_issues(self): """ Return list of all the issues in the repo """