Michael Pasternak has posted comments on this change. Change subject: cli: show command should retrieve sdk collection.get() method's args dynamically ......................................................................
Patch Set 1: Code-Review-1 (4 comments) http://gerrit.ovirt.org/#/c/24710/1/src/ovirtcli/shell/showcmdshell.py File src/ovirtcli/shell/showcmdshell.py: Line 24: Line 25: class ShowCmdShell(CmdShell): Line 26: NAME = 'show' Line 27: ALIAS = 'get' Line 28: #TODO: retrieve options dynamically please remove this TODO Line 29: OPTIONS = ['name', 'id'] Line 30: Line 31: def __init__(self, context, parser): Line 32: CmdShell.__init__(self, context, parser) Line 25: class ShowCmdShell(CmdShell): Line 26: NAME = 'show' Line 27: ALIAS = 'get' Line 28: #TODO: retrieve options dynamically Line 29: OPTIONS = ['name', 'id'] this ^ is no longer meeded Line 30: Line 31: def __init__(self, context, parser): Line 32: CmdShell.__init__(self, context, parser) Line 33: Line 54: callback=self.__add_resource_specific_options) Line 55: return AutoCompletionHelper.complete(line=line, Line 56: text=text, Line 57: args=args, Line 58: common_options=ShowCmdShell.OPTIONS, there are no common_options anymore [1], you should be using now only your dynamic findings rather than static ShowCmdShell.OPTIONS, [1] take for instance snaphsots.get() it has --id or ---description, but no --name option Line 59: specific_options=specific_options) Line 60: def is_show_argument(self, line, key): Line 61: args = TypeHelper.get_types_by_method(False, ShowCmdShell.ALIAS, expendNestedTypes=True) Line 62: if key in args: Line 56: text=text, Line 57: args=args, Line 58: common_options=ShowCmdShell.OPTIONS, Line 59: specific_options=specific_options) Line 60: def is_show_argument(self, line, key): this method should be changed according to the dynamic args you've discovered. Line 61: args = TypeHelper.get_types_by_method(False, ShowCmdShell.ALIAS, expendNestedTypes=True) Line 62: if key in args: Line 63: return True Line 64: -- To view, visit http://gerrit.ovirt.org/24710 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If9e0bce51f3a973049bffaa243aa1bd42e0ae25d Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine-cli Gerrit-Branch: master Gerrit-Owner: Ravi Nori <[email protected]> Gerrit-Reviewer: Juan Hernandez <[email protected]> Gerrit-Reviewer: Michael Pasternak <[email protected]> Gerrit-Reviewer: Ravi Nori <[email protected]> Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
