Merge pull request #661 from kernelkit/veth-delete

Fix test issues after adding veth-delete test

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2024-09-27 17:40:30 +02:00
committed by GitHub
6 changed files with 32 additions and 11 deletions
+2
View File
@@ -83,6 +83,8 @@ documentation for details.
interface changes (tries to delete both ends of the pair)
- Spellcheck path to `/var/lib/containers` when unpacking OCI archives
on container upgrade
- cli: restore `tcpdump` permissions for administrator level users,
regression introduced in v24.08.0
- The timeout before giving up on loading the `startup-config` at boot
is now 1 minute, just like operations via other front-ends (NETCONF
and RESTCONF). This was previously (incorrectly) set to 10 seconds
@@ -2,8 +2,9 @@
# Migrate infix-shell-type:bash -> infix-system:bash
file=$1
temp=$1.tmp
jq '.["ietf-system:system"].authentication.user |= map(.["infix-system:shell"] |= gsub("infix-shell-type:"; ""))' "$file" > "$temp"
mv "$temp" "$file"
temp=${file}.tmp
if jq -e '.["ietf-system:system"]?.authentication?.user? | length > 0' "$file" > /dev/null 2>&1; then
jq '.["ietf-system:system"].authentication.user |= map(.["infix-system:shell"] |= gsub("infix-shell-type:"; ""))' "$file" > "$temp"
mv "$temp" "$file"
fi
@@ -1,7 +1,19 @@
#!/bin/sh
# migrate ietf-routing-type => infix-routing-type
file=$1
temp=$1.tmp
jq '(.["ietf-routing:routing"]."control-plane-protocols"."control-plane-protocol"[] | select(.type == "ietf-ospf:ospfv2").type) |= "infix-routing:ospfv2"' "$file" > "$temp"
jq '(.["ietf-routing:routing"]."control-plane-protocols"."control-plane-protocol"[] | select(.type == "static").type) |= "infix-routing:static"' "$temp" > "$file"
migrate_routing_type()
{
file=$1
match=$2
replace=$3
if jq -e '.["ietf-routing:routing"]?."control-plane-protocols"?."control-plane-protocol"?[] | length > 0' "$file" > /dev/null 2>&1; then
jq --arg match "${match}" --arg replace "${replace}" '
(.["ietf-routing:routing"]."control-plane-protocols"."control-plane-protocol"[] |
select(.type == $match).type) |= $replace' "${file}" > "${file}.tmp"
mv "${file}.tmp" "${file}"
fi
}
migrate_routing_type "$1" "ietf-ospf:ospfv2" "infix-routing:ospfv2"
migrate_routing_type "$1" "static" "infix-routing:static"
+1 -1
View File
@@ -1657,7 +1657,7 @@ static int netdag_gen_iface_del(struct dagger *net, struct lyd_node *dif,
if (dagger_should_skip_current(net, ifname))
return 0;
if (!strcmp(iftype, "infix-if-type:veth")) {
if (iftype && !strcmp(iftype, "infix-if-type:veth")) {
struct lyd_node *node;
const char *peer;
+1 -1
View File
@@ -528,7 +528,7 @@
count=${KLISH_PARAM_cnt:+-c $KLISH_PARAM_cnt}
size=${KLISH_PARAM_sz:+-s $KLISH_PARAM_sz}
verbose=${KLISH_PARAM_verbose:+-vvv}
tcpdump -ln $count $size $verbose -i $KLISH_PARAM_iface $KLISH_PARAM_expr
doas tcpdump -ln $count $size $verbose -i $KLISH_PARAM_iface $KLISH_PARAM_expr
</ACTION>
</COMMAND>
+7 -1
View File
@@ -207,7 +207,13 @@ class Device(Transport):
dspath = f"{dspath}/{path}"
url = f"{self.restconf_url}{dspath}"
return self._get_raw(url, parse)
try:
return self._get_raw(url, parse)
except requests.exceptions.HTTPError as e:
if e.response.status_code == 404:
return None
else:
raise e
def get_running(self, path=None):
"""Wrapper function to get running datastore"""