From ff60afcadd941dab849dc3cd3c689ebb9b0b9f06 Mon Sep 17 00:00:00 2001 From: Lenka Doudova Date: Nov 01 2016 11:22:19 +0000 Subject: Tests: Fix failing test_ipalib/test_parameters Parameters test fails because of KeyError caused by improper manipulation with kwargs in Param.__init__ method. During initialization, if kwargs['required'] or kwargs['multivalue'] is None, it is delete from dictionary and hence the missing key. Small change of the condition prevents this from happening. Partially fixes https://fedorahosted.org/freeipa/ticket/6292 Backported to ipa-4-4 branch as per https://fedorahosted.org/freeipa/ticket/6395 Reviewed-By: Martin Babinsky --- diff --git a/ipalib/parameters.py b/ipalib/parameters.py index 37f9650..12119cb 100644 --- a/ipalib/parameters.py +++ b/ipalib/parameters.py @@ -472,7 +472,7 @@ class Param(ReadOnly): CALLABLE_ERROR % (key, value, type(value)) ) kw[key] = value - else: + elif key not in ('required', 'multivalue'): kw.pop(key, None) # We keep these values to use in __repr__():