Revision e1494c96 lib/opcodes.py
b/lib/opcodes.py | ||
---|---|---|
397 | 397 |
return True |
398 | 398 |
|
399 | 399 |
|
400 |
_TIpAddress = ht.TOr(ht.TNone, ht.TAnd(ht.TString, _CheckCIDRNetNotation)) |
|
401 |
_TIpAddress6 = ht.TOr(ht.TNone, ht.TAnd(ht.TString, _CheckCIDR6NetNotation)) |
|
400 |
_TIpAddress4 = ht.TAnd(ht.TString, _CheckCIDRAddrNotation) |
|
401 |
_TIpAddress6 = ht.TAnd(ht.TString, _CheckCIDR6AddrNotation) |
|
402 |
_TIpNetwork4 = ht.TAnd(ht.TString, _CheckCIDRNetNotation) |
|
403 |
_TIpNetwork6 = ht.TAnd(ht.TString, _CheckCIDR6NetNotation) |
|
404 |
_TMaybeAddr4List = ht.TMaybe(ht.TListOf(_TIpAddress4)) |
|
402 | 405 |
|
403 | 406 |
|
404 | 407 |
class _AutoOpParamSlots(objectutils.AutoSlots): |
... | ... | |
2018 | 2021 |
OP_PARAMS = [ |
2019 | 2022 |
_PNetworkName, |
2020 | 2023 |
_PNetworkType, |
2021 |
("network", None, _TIpAddress, "IPv4 subnet"),
|
|
2022 |
("gateway", None, _TIpAddress, "IPv4 gateway"),
|
|
2023 |
("network6", None, _TIpAddress6, "IPv6 subnet"),
|
|
2024 |
("gateway6", None, _TIpAddress6, "IPv6 gateway"),
|
|
2024 |
("network", ht.NoDefault, _TIpNetwork4, "IPv4 subnet"),
|
|
2025 |
("gateway", None, ht.TMaybe(_TIpAddress4), "IPv4 gateway"),
|
|
2026 |
("network6", None, ht.TMaybe(_TIpNetwork6), "IPv6 subnet"),
|
|
2027 |
("gateway6", None, ht.TMaybe(_TIpAddress6), "IPv6 gateway"),
|
|
2025 | 2028 |
("mac_prefix", None, ht.TMaybeString, |
2026 | 2029 |
"MAC address prefix that overrides cluster one"), |
2027 |
("add_reserved_ips", None, |
|
2028 |
ht.TMaybe(ht.TListOf(_CheckCIDRAddrNotation)), |
|
2030 |
("add_reserved_ips", None, _TMaybeAddr4List, |
|
2029 | 2031 |
"Which IP addresses to reserve"), |
2030 | 2032 |
("tags", ht.EmptyList, ht.TListOf(ht.TNonEmptyString), "Network tags"), |
2031 | 2033 |
] |
... | ... | |
2051 | 2053 |
OP_PARAMS = [ |
2052 | 2054 |
_PNetworkName, |
2053 | 2055 |
_PNetworkType, |
2054 |
("gateway", None, _TIpAddress, "IPv4 gateway"),
|
|
2055 |
("network6", None, _TIpAddress6, "IPv6 subnet"),
|
|
2056 |
("gateway6", None, _TIpAddress6, "IPv6 gateway"),
|
|
2056 |
("gateway", None, ht.TMaybe(_TIpAddress4), "IPv4 gateway"),
|
|
2057 |
("network6", None, ht.TMaybe(_TIpNetwork6), "IPv6 subnet"),
|
|
2058 |
("gateway6", None, ht.TMaybe(_TIpAddress6), "IPv6 gateway"),
|
|
2057 | 2059 |
("mac_prefix", None, ht.TMaybeString, |
2058 | 2060 |
"MAC address prefix that overrides cluster one"), |
2059 |
("add_reserved_ips", None, |
|
2060 |
ht.TMaybe(ht.TListOf(_CheckCIDRAddrNotation)), |
|
2061 |
("add_reserved_ips", None, _TMaybeAddr4List, |
|
2061 | 2062 |
"Which external IP addresses to reserve"), |
2062 |
("remove_reserved_ips", None, |
|
2063 |
ht.TMaybe(ht.TListOf(_CheckCIDRAddrNotation)), |
|
2063 |
("remove_reserved_ips", None, _TMaybeAddr4List, |
|
2064 | 2064 |
"Which external IP addresses to release"), |
2065 | 2065 |
] |
2066 | 2066 |
OP_RESULT = ht.TNone |
... | ... | |
2078 | 2078 |
OP_PARAMS = [ |
2079 | 2079 |
_PGroupName, |
2080 | 2080 |
_PNetworkName, |
2081 |
("network_mode", None, ht.TMaybeString, "Connectivity mode"),
|
|
2082 |
("network_link", None, ht.TMaybeString, "Connectivity link"),
|
|
2081 |
("network_mode", ht.NoDefault, ht.TString, "Connectivity mode"),
|
|
2082 |
("network_link", ht.NoDefault, ht.TString, "Connectivity link"),
|
|
2083 | 2083 |
("conflicts_check", True, ht.TBool, "Whether to check for conflicting IPs"), |
2084 | 2084 |
] |
2085 | 2085 |
OP_RESULT = ht.TNone |
Also available in: Unified diff