Merge pull request #242191 from tie/systemd-required-for-online-range

This commit is contained in:
Ryan Lahfa 2023-09-30 01:16:21 +02:00 committed by GitHub
commit 3c3ef90189
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -517,17 +517,24 @@ let
(assertValueOneOf "Unmanaged" boolValues)
(assertInt "Group")
(assertRange "Group" 0 2147483647)
(assertValueOneOf "RequiredForOnline" (boolValues ++ [
"missing"
"off"
"no-carrier"
"dormant"
"degraded-carrier"
"carrier"
"degraded"
"enslaved"
"routable"
]))
(assertValueOneOf "RequiredForOnline" (boolValues ++ (
let
# https://freedesktop.org/software/systemd/man/networkctl.html#missing
operationalStates = [
"missing"
"off"
"no-carrier"
"dormant"
"degraded-carrier"
"carrier"
"degraded"
"enslaved"
"routable"
];
operationalStateRanges = concatLists (imap0 (i: min: map (max: "${min}:${max}") (drop i operationalStates)) operationalStates);
in
operationalStates ++ operationalStateRanges
)))
(assertValueOneOf "RequiredFamilyForOnline" [
"ipv4"
"ipv6"