python-gitlab / python-gitlab

A python wrapper for the GitLab API.

Home Page:https://python-gitlab.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Available project integrations not callable from the CLI

Sjord opened this issue · comments

slug is both required and unexpected:

$ python -m gitlab project-service available --project-id 1
...
__main__.py project-service available: error: the following arguments are required: --slug
$ python -m gitlab project-service available --project-id 1 --slug slack
...
TypeError: ProjectIntegrationManager.available() got an unexpected keyword argument 'slug'

ProjectIntegration:

class ProjectIntegration(SaveMixin, ObjectDeleteMixin, RESTObject):
    _id_attr = "slug"

In cli.py:

# We need to get the object somehow
if not issubclass(cls, gitlab.mixins.GetWithoutIdMixin):
    if cls._id_attr is not None:
        id_attr = cls._id_attr.replace("_", "-")
        sub_parser_action.add_argument(f"--{id_attr}", required=True)