diff options
author | Karol Ossowski <karol.ossowski@gmail.com> | 2019-04-24 11:49:22 +0200 |
---|---|---|
committer | Karol Ossowski <karol.ossowski@gmail.com> | 2019-04-24 11:49:22 +0200 |
commit | adb63054add31e06cefec09982a02b1cd21c2cbd (patch) | |
tree | 8d02b8c6eaf203e62b292666186aaf3f288ea54b /gitlab/v4/cli.py | |
parent | a3a771310de16be7bba041c962223f7bda9aa4d6 (diff) | |
download | gitlab-adb63054add31e06cefec09982a02b1cd21c2cbd.tar.gz |
dont ask for id attr if this is *Manager originating custom action
Diffstat (limited to 'gitlab/v4/cli.py')
-rw-r--r-- | gitlab/v4/cli.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gitlab/v4/cli.py b/gitlab/v4/cli.py index 242874d..8ad75ae 100644 --- a/gitlab/v4/cli.py +++ b/gitlab/v4/cli.py @@ -217,14 +217,14 @@ def _populate_sub_parser_by_class(cls, sub_parser): for x in mgr_cls._from_parent_attrs] sub_parser_action.add_argument("--sudo", required=False) + required, optional, needs_id = cli.custom_actions[name][action_name] # We need to get the object somehow - if gitlab.mixins.GetWithoutIdMixin not in inspect.getmro(cls): + if needs_id and gitlab.mixins.GetWithoutIdMixin not in inspect.getmro(cls): if cls._id_attr is not None: id_attr = cls._id_attr.replace('_', '-') sub_parser_action.add_argument("--%s" % id_attr, required=True) - required, optional, dummy = cli.custom_actions[name][action_name] [sub_parser_action.add_argument("--%s" % x.replace('_', '-'), required=True) for x in required if x != cls._id_attr] |