mirror of
https://github.com/linux-system-roles/network.git
synced 2026-01-23 02:15:17 +00:00
feat: Support wait_ip property
Add support for the `wait_ip` property, the system will consider
connection activated only when specific IP stack is configured.
This enables flexibility in scenarios such as
IPv6-only networks, where the overall network configuration can still
succeed when IPv4 configuration fails but IPv6 completes successfully.
The `wait_ip` can be configured with the following possible values:
* "any": System will consider interface activated when any IP stack is
configured.
* "ipv4": System will wait IPv4 been configured.
* "ipv6": System will wait IPv6 been configured.
* "ipv4+ipv6": System will wait both IPv4 and IPv6 been configured.
Resolves: https://issues.redhat.com/browse/RHEL-63026
Signed-off-by: Wen Liang <wenliang@redhat.com>
This commit is contained in:
parent
38a61f76e9
commit
d92baacf1f
8 changed files with 128 additions and 0 deletions
|
|
@ -907,6 +907,11 @@ class ArgValidator_DictIP(ArgValidatorDict):
|
|||
ArgValidatorBool("auto6", default_value=None),
|
||||
ArgValidatorBool("ipv4_ignore_auto_dns", default_value=None),
|
||||
ArgValidatorBool("ipv6_ignore_auto_dns", default_value=None),
|
||||
ArgValidatorStr(
|
||||
"wait_ip",
|
||||
enum_values=["any", "ipv4", "ipv6", "ipv4+ipv6"],
|
||||
default_value="any",
|
||||
),
|
||||
ArgValidatorBool("ipv6_disabled", default_value=None),
|
||||
ArgValidatorIP("gateway6", family=socket.AF_INET6),
|
||||
ArgValidatorNum(
|
||||
|
|
@ -960,6 +965,7 @@ class ArgValidator_DictIP(ArgValidatorDict):
|
|||
"auto6": True,
|
||||
"ipv4_ignore_auto_dns": None,
|
||||
"ipv6_ignore_auto_dns": None,
|
||||
"wait_ip": "any",
|
||||
"ipv6_disabled": False,
|
||||
"gateway6": None,
|
||||
"route_metric6": None,
|
||||
|
|
@ -2522,6 +2528,14 @@ class ArgValidator_ListConnections(ArgValidatorList):
|
|||
"ip.ipv4_ignore_auto_dns or ip.ipv6_ignore_auto_dns is not "
|
||||
"supported by initscripts.",
|
||||
)
|
||||
# initscripts does not support ip.wait_ip,
|
||||
# so raise errors when network provider is initscripts
|
||||
if connection["ip"]["wait_ip"] != "any":
|
||||
if mode == self.VALIDATE_ONE_MODE_INITSCRIPTS:
|
||||
raise ValidationError.from_connection(
|
||||
idx,
|
||||
"ip.wait_ip is not supported by initscripts.",
|
||||
)
|
||||
# initscripts does not support ip.dns_options, so raise errors when network
|
||||
# provider is initscripts
|
||||
if connection["ip"]["dns_options"]:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue