def do_custom(self):
in_obj = cli.custom_actions[self.cls_name][self.action][2]
# Get the object (lazy), then act
if in_obj:
data = {}
if hasattr(self.mgr, '_from_parent_attrs'):
for k in self.mgr._from_parent_attrs:
data[k] = self.args[k]
if gitlab.mixins.GetWithoutIdMixin not in inspect.getmro(self.cls):
data[self.cls._id_attr] = self.args.pop(self.cls._id_attr)
o = self.cls(self.mgr, data)
method_name = self.action.replace('-', '_')
return getattr(o, method_name)(**self.args)
else:
return getattr(self.mgr, self.action)(**self.args)
评论列表
文章目录