From e9c1d21b9fec17ab13894885eb1238631ecc43e5 Mon Sep 17 00:00:00 2001 From: Jan Cholasta Date: Mon, 8 Aug 2016 13:09:39 +0200 Subject: parameters: move the `confirm` kwarg to Param Whether a parameter is treated like password is determined by the `password` class attribute defined in the Param class. Whether the CLI will asks for confirmation of a password parameter depends on the value of the `confirm` kwarg of the Password class. Move the `confirm` kwarg from the Password class to the Param class, so that it can be used by any Param subclass which has the `password` class attribute set to True. This fixes confirmation of the --key option of otptoken-add, which is a Bytes subclass with `password` set to True. https://fedorahosted.org/freeipa/ticket/6174 Reviewed-By: Martin Basti Reviewed-By: David Kupka --- ipaclient/remote_plugins/schema.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ipaclient/remote_plugins') diff --git a/ipaclient/remote_plugins/schema.py b/ipaclient/remote_plugins/schema.py index a215452ea..c06d6d278 100644 --- a/ipaclient/remote_plugins/schema.py +++ b/ipaclient/remote_plugins/schema.py @@ -167,7 +167,7 @@ class _SchemaPlugin(object): elif key in ('cli_metavar', 'cli_name'): kwargs[key] = str(value) - elif key == 'confirm' and issubclass(cls, Password): + elif key == 'confirm': kwargs[key] = value elif key == 'default': default = value -- cgit