Skip to content

Commit 77e14fd

Browse files
committed
refact: Renamed netmask property to network-mask
1 parent 138c64b commit 77e14fd

4 files changed

Lines changed: 12 additions & 12 deletions

File tree

‎system/cuos/init.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,8 +367,8 @@ configure_network() {
367367
.routes // empty |
368368
(if type=="array" then .[] else . end) |
369369
(.network // "") as $d |
370+
(."network-mask" // "") as $m |
370371
(.gateway // "") as $g |
371-
(.netmask // "") as $m |
372372
[$d, $g, $m] | @tsv' |
373373
while IFS=$'\t' read -r RDEST RGW RMASK; do
374374
if [ -z "$RDEST" ] || [ -z "$RGW" ]; then

‎system/cuos/init.test.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ expect \
9090
export CONFIG_PATH="${SCRIPT_DIR}/init.test.system2.json"
9191
expect \
9292
"configure_network 2: eth0: 155.7, eth1: dhcp" \
93-
$'auto lo\niface lo inet loopback\n\nauto eth0\niface eth0 inet static\n address 192.168.155.7\n netmask 255.255.255.128\n gateway 192.168.155.1\n dns-nameservers 192.168.155.1 192.168.155.2\n ntp-servers 192.168.155.1 192.168.155.2\n\n up ip route add 192.168.77.0/11 via 255.255.255.0 dev eth0\n down ip route del 192.168.77.0/11 via 255.255.255.0 dev eth0\nauto eth1\niface eth1 inet dhcp\n metric 20' \
93+
$'auto lo\niface lo inet loopback\n\nauto eth0\niface eth0 inet static\n address 192.168.155.7\n netmask 255.255.255.128\n gateway 192.168.155.1\n dns-nameservers 192.168.155.1 192.168.155.2\n ntp-servers 192.168.155.1 192.168.155.2\n\n up ip route add 192.168.77.0/24 via 192.168.155.1 dev eth0\n down ip route del 192.168.77.0/24 via 192.168.155.1 dev eth0\nauto eth1\niface eth1 inet dhcp\n metric 20' \
9494
configure_network
9595

9696
export CONFIG_PATH="${SCRIPT_DIR}/init.test.system3.json"

‎system/cuos/init.test.system2.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
"routes": [
1414
{
1515
"network": "192.168.77.0",
16-
"gateway": "255.255.255.0",
17-
"netmask": "192.168.155.1"
16+
"network-mask": "255.255.255.0",
17+
"gateway": "192.168.155.1"
1818
}
1919
]
2020
},

‎system/cuos/system-schema.json‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,17 +82,17 @@
8282
"description": "Alias for destination (used by CuOS)",
8383
"pattern": "^\\d{1,3}(\\.\\d{1,3}){3}(/\\d{1,2})?$"
8484
},
85-
"gateway": {
86-
"type": "string",
87-
"description": "Next-hop IPv4 address for the route",
88-
"pattern": "^\\d{1,3}(\\.\\d{1,3}){3}$"
89-
},
90-
"netmask": {
85+
"network-mask": {
9186
"description": "Subnet mask for the destination. Accepts dotted-decimal (e.g. '255.255.255.0') or numeric prefix (e.g. 24).",
9287
"oneOf": [
9388
{ "type": "string", "pattern": "^\\d{1,3}(\\.\\d{1,3}){3}$" },
9489
{ "type": "integer", "minimum": 0, "maximum": 32 }
9590
]
91+
},
92+
"gateway": {
93+
"type": "string",
94+
"description": "Next-hop IPv4 address for the route",
95+
"pattern": "^\\d{1,3}(\\.\\d{1,3}){3}$"
9696
}
9797
},
9898
"additionalProperties": false
@@ -103,8 +103,8 @@
103103
"type": "object",
104104
"properties": {
105105
"network": { "type": "string", "pattern": "^\\d{1,3}(\\.\\d{1,3}){3}(/\\d{1,2})?$" },
106-
"gateway": { "type": "string", "pattern": "^\\d{1,3}(\\.\\d{1,3}){3}$" },
107-
"netmask": { "oneOf": [ { "type": "string", "pattern": "^\\d{1,3}(\\.\\d{1,3}){3}$" }, { "type": "integer", "minimum": 0, "maximum": 32 } ] }
106+
"network-mask": { "oneOf": [ { "type": "string", "pattern": "^\\d{1,3}(\\.\\d{1,3}){3}$" }, { "type": "integer", "minimum": 0, "maximum": 32 } ] },
107+
"gateway": { "type": "string", "pattern": "^\\d{1,3}(\\.\\d{1,3}){3}$" }
108108
},
109109
"additionalProperties": false
110110
}

0 commit comments

Comments
 (0)