diff --git a/osc-staging.py b/osc-staging.py index af3f1bf2..944074d7 100644 --- a/osc-staging.py +++ b/osc-staging.py @@ -20,6 +20,7 @@ sys.path.append(_plugin_dir) from osclib.stagingapi import StagingAPI from osclib.request_finder import RequestFinder from osclib.select_command import SelectCommand +from osclib.unselect_command import UnselectCommand from osclib.accept_command import AcceptCommand from osclib.cleanup_rings import CleanupRings from osclib.list_command import ListCommand diff --git a/osclib/request_finder.py b/osclib/request_finder.py index aba58d0f..1213c574 100644 --- a/osclib/request_finder.py +++ b/osclib/request_finder.py @@ -219,13 +219,12 @@ class RequestFinder(object): return finder.srs @classmethod - def find_staged_sr(cls, pkgs, apiurl, stagingapi): + def find_staged_sr(cls, pkgs, stagingapi): """ Search for all various mutations and return a single SR#s. :param pkgs: mesh of argumets to search for (SR#|package name) - :param apiurl: OBS url :param stagingapi: StagingAPI instance """ - finder = cls(apiurl, stagingapi) + finder = cls(stagingapi.apiurl, stagingapi) finder.find_via_stagingapi(pkgs) return finder.srs diff --git a/osclib/unselect_command.py b/osclib/unselect_command.py index 5e148a95..8a98a612 100644 --- a/osclib/unselect_command.py +++ b/osclib/unselect_command.py @@ -14,7 +14,7 @@ class UnselectCommand(object): Remove request from staging project :param packages: packages/requests to delete from staging projects """ - for request, request_project in RequestFinder.find_staged_sr(packages, opts.apiurl, api).items(): + for request, request_project in RequestFinder.find_staged_sr(packages, self.api).items(): staging_project = request_project['staging'] print('Unselecting "{}" from "{}"'.format(request, staging_project)) self.api.rm_from_prj(staging_project, request_id=request)