Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitef32990

Browse files
authored
Merge pull request#776 from python-gitlab/revert-760-custom_cli_actions_fix
Revert "Custom cli actions fix"
2 parentse8823e9 +d3a20c5 commitef32990

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

‎gitlab/v4/cli.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ def do_custom(self):
8080
ifgitlab.mixins.GetWithoutIdMixinnotininspect.getmro(self.cls):
8181
data[self.cls._id_attr]=self.args.pop(self.cls._id_attr)
8282
o=self.cls(self.mgr,data)
83+
method_name=self.action.replace('-','_')
84+
returngetattr(o,method_name)(**self.args)
8385
else:
84-
o=self.mgr
85-
method_name=self.action.replace('-','_')
86-
returngetattr(o,method_name)(**self.args)
86+
returngetattr(self.mgr,self.action)(**self.args)
8787

8888
defdo_project_export_download(self):
8989
try:
@@ -217,14 +217,14 @@ def _populate_sub_parser_by_class(cls, sub_parser):
217217
forxinmgr_cls._from_parent_attrs]
218218
sub_parser_action.add_argument("--sudo",required=False)
219219

220-
required,optional,needs_id=cli.custom_actions[name][action_name]
221220
# We need to get the object somehow
222-
ifneeds_idandgitlab.mixins.GetWithoutIdMixinnotininspect.getmro(cls):
221+
ifgitlab.mixins.GetWithoutIdMixinnotininspect.getmro(cls):
223222
ifcls._id_attrisnotNone:
224223
id_attr=cls._id_attr.replace('_','-')
225224
sub_parser_action.add_argument("--%s"%id_attr,
226225
required=True)
227226

227+
required,optional,dummy=cli.custom_actions[name][action_name]
228228
[sub_parser_action.add_argument("--%s"%x.replace('_','-'),
229229
required=True)
230230
forxinrequiredifx!=cls._id_attr]

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp