mirror of
https://github.com/linux-system-roles/network.git
synced 2026-01-23 02:15:17 +00:00
arg_validator: use DEFAULT argument to generate default value for dictionaries
The previous solution was ugly, as it hacked the private self._default_value of the parent. Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
parent
e01e550c59
commit
63ddf64a41
1 changed files with 4 additions and 18 deletions
|
|
@ -758,11 +758,7 @@ class ArgValidator_DictEthtool(ArgValidatorDict):
|
|||
ArgValidator_DictEthtoolCoalesce(),
|
||||
ArgValidator_DictEthtoolRing(),
|
||||
],
|
||||
default_value=ArgValidator.MISSING,
|
||||
)
|
||||
|
||||
self._default_value = dict(
|
||||
[(k, v.get_default_value()) for k, v in self.nested.items()]
|
||||
default_value=ArgValidator.DEFAULT,
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -963,13 +959,7 @@ class ArgValidator_DictEthtoolFeatures(ArgValidatorDict):
|
|||
deprecated_by="tx_vlan_stag_hw_insert",
|
||||
),
|
||||
],
|
||||
)
|
||||
self._default_value = dict(
|
||||
[
|
||||
(name, validator.get_default_value())
|
||||
for name, validator in self.nested.items()
|
||||
if not isinstance(validator, ArgValidatorDeprecated)
|
||||
]
|
||||
default_value=ArgValidator.DEFAULT,
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -1048,9 +1038,7 @@ class ArgValidator_DictEthtoolCoalesce(ArgValidatorDict):
|
|||
"tx_usecs_low", val_min=0, val_max=UINT32_MAX, default_value=None
|
||||
),
|
||||
],
|
||||
)
|
||||
self._default_value = dict(
|
||||
[(k, v.get_default_value()) for k, v in self.nested.items()]
|
||||
default_value=ArgValidator.DEFAULT,
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -1073,9 +1061,7 @@ class ArgValidator_DictEthtoolRing(ArgValidatorDict):
|
|||
"tx", val_min=0, val_max=UINT32_MAX, default_value=None
|
||||
),
|
||||
],
|
||||
)
|
||||
self._default_value = dict(
|
||||
[(k, v.get_default_value()) for k, v in self.nested.items()]
|
||||
default_value=ArgValidator.DEFAULT,
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue