Changeset View
Changeset View
Standalone View
Standalone View
swh/lister/fedora/tasks.py
- This file was added.
# Copyright (C) 2022 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 Dict, List, Optional | |||||||||
from celery import shared_task | |||||||||
from .lister import FedoraLister | |||||||||
@shared_task(name=__name__ + ".FullFedoraRelister") | |||||||||
def list_fedora_full( | |||||||||
url: str, | |||||||||
instance: Optional[str] = None, | |||||||||
releases: List[str] = None, | |||||||||
) -> Dict[str, int]: | |||||||||
"""Full update of a Fedora instance""" | |||||||||
vlorentzUnsubmitted Done Inline Actions
vlorentz: | |||||||||
lister = FedoraLister.from_configfile( | |||||||||
url=url, | |||||||||
instance=instance, | |||||||||
releases=releases, | |||||||||
) | |||||||||
return lister.run().dict() | |||||||||
Not Done Inline ActionsIt is better to not hardcode task arguments as in other lister tasks, use this instead: @shared_task(name=__name__ + ".FullFedoraRelister") def list_fedora_full(**lister_args) -> Dict[str, int]: """Full update of a Fedora instance""" lister = FedoraLister.from_configfile(**lister_args) return lister.run().dict() anlambert: It is better to not hardcode task arguments as in other lister tasks, use this instead… | |||||||||
@shared_task(name=__name__ + ".ping") | |||||||||
def _ping() -> str: | |||||||||
return "OK" |