From b48f71ff932b190c83003488824135b6aa5d22e6 Mon Sep 17 00:00:00 2001 From: Antoine Lambert Date: Mon, 11 Jan 2021 16:22:17 +0100 Subject: [PATCH] phabricator/tasks: Allow to pass api_token as optional parameter This is useful when one wants to test the lister in docker environment. --- swh/lister/phabricator/tasks.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/swh/lister/phabricator/tasks.py b/swh/lister/phabricator/tasks.py index 98e01e1..2b47042 100644 --- a/swh/lister/phabricator/tasks.py +++ b/swh/lister/phabricator/tasks.py @@ -1,16 +1,20 @@ -# Copyright (C) 2019 the Software Heritage developers +# Copyright (C) 2019-2021 the Software Heritage developers # License: GNU General Public License version 3, or any later version # See top-level LICENSE file for more information +from typing import Optional + from celery import shared_task from swh.lister.phabricator.lister import PhabricatorLister @shared_task(name=__name__ + ".FullPhabricatorLister") -def list_phabricator_full(url: str, instance: str): +def list_phabricator_full(url: str, instance: str, api_token: Optional[str] = None): """Full update of a Phabricator instance""" - return PhabricatorLister.from_configfile(url=url, instance=instance).run() + return PhabricatorLister.from_configfile( + url=url, instance=instance, api_token=api_token + ).run() @shared_task(name=__name__ + ".ping")