diff --git a/sktm/__init__.py b/sktm/__init__.py index 23dc84f..3a9fb96 100644 --- a/sktm/__init__.py +++ b/sktm/__init__.py @@ -206,9 +206,6 @@ def get_patch_info_from_url(self, interface, patch_url): baseurl = match.group(1) patch_id = int(match.group(2)) patch = interface.get_patch_by_id(patch_id) - if patch is None: - raise Exception('Can\'t get data for %s' % patch_url) - logging.info('patch: [%d] %s', patch_id, patch.get('name')) if isinstance(interface, sktm.patchwork.PatchworkV2Project): diff --git a/sktm/patchwork.py b/sktm/patchwork.py index 215913a..b5a729e 100644 --- a/sktm/patchwork.py +++ b/sktm/patchwork.py @@ -762,16 +762,15 @@ def get_patchsets(self, patchlist): # For each patch ID for pid in patchlist: patch = self.get_patch_by_id(pid) - if patch: - # For each series the patch belongs to - for series in patch.get("series"): - sid = series.get("id") - if sid not in seen: - series_list += self.__get_series_from_url( - join_with_slash(self.apiurls.get("series"), - str(sid)) - ) - seen.add(sid) + # For each series the patch belongs to + for series in patch.get("series"): + sid = series.get("id") + if sid not in seen: + series_list += self.__get_series_from_url( + join_with_slash(self.apiurls.get("series"), + str(sid)) + ) + seen.add(sid) return series_list @@ -908,8 +907,7 @@ def get_patch_by_id(self, pid): patch = self.rpc.patch_get(pid, self.fields) if patch is None or patch == {}: - logging.warning("Failed to get data for patch %d", pid) - patch = None + raise Exception('Can\'t get patch by id %d)'.format(pid)) self.__update_patch_name(patch) @@ -1169,8 +1167,7 @@ def get_patchsets(self, patchlist): logging.debug("get_patchsets: %s", patchlist) for pid in patchlist: patch = self.get_patch_by_id(pid) - if patch: - pset = self.__parse_patch(patch) - if pset: - series_list.append(pset) + pset = self.__parse_patch(patch) + if pset: + series_list.append(pset) return series_list