Skip to content

Commit ca2ce49

Browse files
committed
fix: empty access-lists, prefix-lists and route-maps
1 parent 1fa625a commit ca2ce49

File tree

4 files changed

+31
-25
lines changed

4 files changed

+31
-25
lines changed

checks/frr.nix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ pkgs.testers.nixosTest {
9999
machine.wait_for_unit("frr.service")
100100
print(machine.succeed("vtysh -c 'show run'"))
101101
# TODO validate
102-
machine.succeed("vtysh -c 'show ipv6 prefix-list own-6 json' | ${lib.getExe pkgs.jq}")
103-
machine.succeed("vtysh -c 'show route-map import json' | ${lib.getExe pkgs.jq}")
104-
machine.succeed("vtysh -c 'show route-map export json' | ${lib.getExe pkgs.jq}")
102+
print(machine.succeed("vtysh -c 'show ipv6 prefix-list own-6 json' | ${lib.getExe pkgs.jq}"))
103+
print(machine.succeed("vtysh -c 'show route-map import json' | ${lib.getExe pkgs.jq}"))
104+
print(machine.succeed("vtysh -c 'show route-map export json' | ${lib.getExe pkgs.jq}"))
105105
'';
106106
}

modules/access-list.nix

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,15 @@ let
5959
in
6060
{
6161
options.services.frr.settings.access-list = mkOption {
62-
type = types.submodule ({
63-
options = {
64-
ip = alOption "ipv4";
65-
ipv6 = alOption "ipv6";
66-
bgp_as-path = alOption "bgp as-path";
67-
};
68-
});
62+
type = types.nullOr (
63+
types.submodule ({
64+
options = {
65+
ip = alOption "ipv4";
66+
ipv6 = alOption "ipv6";
67+
bgp_as-path = alOption "bgp as-path";
68+
};
69+
})
70+
);
6971
default = null;
7072
description = ''
7173
[docs.frrouting.org/en/latest/filter.html#ip-access-list](https://docs.frrouting.org/en/latest/filter.html#ip-access-list).

modules/prefix-list.nix

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,14 @@ let
7474
in
7575
{
7676
options.services.frr.settings.prefix-list = mkOption {
77-
type = types.submodule ({
78-
options = {
79-
ip = plOption;
80-
ipv6 = plOption;
81-
};
82-
});
77+
type = types.nullOr (
78+
types.submodule ({
79+
options = {
80+
ip = plOption;
81+
ipv6 = plOption;
82+
};
83+
})
84+
);
8385
default = null;
8486
description = ''
8587
ip prefix-list provides the most powerful prefix based filtering mechanism. In addition to access-list

modules/route-maps.nix

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,17 @@ let
9898
in
9999
{
100100
options.services.frr.settings.route-maps = mkOption {
101-
type = attrsWith' "name" (
102-
with types;
103-
nullOr (submodule {
104-
options = {
105-
permit = rmOption;
106-
optimization = rmOption;
107-
deny = rmOption;
108-
};
109-
})
101+
type = types.nullOr (
102+
attrsWith' "name" (
103+
with types;
104+
nullOr (submodule {
105+
options = {
106+
permit = rmOption;
107+
optimization = rmOption;
108+
deny = rmOption;
109+
};
110+
})
111+
)
110112
);
111113
default = null;
112114
description = ''

0 commit comments

Comments
 (0)