Available project integrations not callable from the CLI
Sjord opened this issue · comments
Sjoerd Langkemper commented
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'
Sjoerd Langkemper commented
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)