Fix some reports for CLI where warning message about Value not found

Fixes #11621
This commit is contained in:
prculley
2020-03-16 11:40:23 -05:00
committed by Paul Culley
parent eb14abbf3e
commit 343633a189

View File

@@ -62,6 +62,7 @@ class EnumeratedListOption(Option):
:type value: int :type value: int
:return: nothing :return: nothing
""" """
self.ini_value = value
Option.__init__(self, label, value) Option.__init__(self, label, value)
self.__items = [] self.__items = []
self.__xml_items = [] self.__xml_items = []
@@ -138,6 +139,8 @@ class EnumeratedListOption(Option):
""" """
if value in (v for v, d in self.__items): if value in (v for v, d in self.__items):
Option.set_value(self, value) Option.set_value(self, value)
elif value == self.ini_value:
return
else: else:
logging.warning(_("Value '%(val)s' not found for option '%(opt)s'") % logging.warning(_("Value '%(val)s' not found for option '%(opt)s'") %
{'val' : str(value), 'opt' : self.get_label()}) {'val' : str(value), 'opt' : self.get_label()})