mirror of
https://github.com/linux-system-roles/network.git
synced 2026-01-23 02:15:17 +00:00
arg_validator: make ArgValidator.DEFAULT the default for dictionary's default value
The most used default value for ArgValidatorDict is ArgValidator.DEFAULT, which means to generate the default value based on the nested validators. ArgValidator.DEFAULT is also a better default for the default_value. Otherwise, it's a bit odd to have (and honor) ArgValidator.DEFAULT, if that is not in fact the default default_value. Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
parent
63ddf64a41
commit
7a1683848c
1 changed files with 3 additions and 5 deletions
|
|
@ -334,7 +334,7 @@ class ArgValidatorDict(ArgValidator):
|
|||
name=None,
|
||||
required=False,
|
||||
nested=None,
|
||||
default_value=None,
|
||||
default_value=ArgValidator.DEFAULT,
|
||||
all_missing_during_validate=False,
|
||||
):
|
||||
if nested is not None:
|
||||
|
|
@ -472,6 +472,7 @@ class ArgValidatorIPAddr(ArgValidatorDict):
|
|||
),
|
||||
ArgValidatorNum("prefix", default_value=None, val_min=0),
|
||||
],
|
||||
default_value=None,
|
||||
)
|
||||
self.family = family
|
||||
|
||||
|
|
@ -524,6 +525,7 @@ class ArgValidatorIPRoute(ArgValidatorDict):
|
|||
"metric", default_value=-1, val_min=-1, val_max=0xFFFFFFFF
|
||||
),
|
||||
],
|
||||
default_value=None,
|
||||
)
|
||||
self.family = family
|
||||
|
||||
|
|
@ -758,7 +760,6 @@ class ArgValidator_DictEthtool(ArgValidatorDict):
|
|||
ArgValidator_DictEthtoolCoalesce(),
|
||||
ArgValidator_DictEthtoolRing(),
|
||||
],
|
||||
default_value=ArgValidator.DEFAULT,
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -959,7 +960,6 @@ class ArgValidator_DictEthtoolFeatures(ArgValidatorDict):
|
|||
deprecated_by="tx_vlan_stag_hw_insert",
|
||||
),
|
||||
],
|
||||
default_value=ArgValidator.DEFAULT,
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -1038,7 +1038,6 @@ class ArgValidator_DictEthtoolCoalesce(ArgValidatorDict):
|
|||
"tx_usecs_low", val_min=0, val_max=UINT32_MAX, default_value=None
|
||||
),
|
||||
],
|
||||
default_value=ArgValidator.DEFAULT,
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -1061,7 +1060,6 @@ class ArgValidator_DictEthtoolRing(ArgValidatorDict):
|
|||
"tx", val_min=0, val_max=UINT32_MAX, default_value=None
|
||||
),
|
||||
],
|
||||
default_value=ArgValidator.DEFAULT,
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue