Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parse: fix renderer validation for nm-devices (LP: #2091755) #532

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -3376,11 +3376,6 @@ handle_network_type(NetplanParser* npp, yaml_node_t* node, const char* key_prefi
case NETPLAN_DEF_TYPE_NM:
g_debug("netplan: %s: handling NetworkManager passthrough device, settings are not fully supported.", npp->current.netdef->id);
handlers = ethernet_def_handlers;
if (npp->current.netdef->backend != NETPLAN_BACKEND_NM) {
g_debug("nm-device: %s: the renderer for nm-devices must be NetworkManager, it will be used instead of the defined one.",
npp->current.netdef->id);
npp->current.netdef->backend = NETPLAN_BACKEND_NM;
}
break;
default: g_assert_not_reached(); // LCOV_EXCL_LINE
}
Expand Down Expand Up @@ -3409,6 +3404,12 @@ handle_network_type(NetplanParser* npp, yaml_node_t* node, const char* key_prefi
}
}

if (npp->current.netdef->type == NETPLAN_DEF_TYPE_NM && npp->current.netdef->backend != NETPLAN_BACKEND_NM) {
g_debug("nm-device: %s: the renderer for nm-devices must be NetworkManager, it will be used instead of the defined one.",
npp->current.netdef->id);
npp->current.netdef->backend = NETPLAN_BACKEND_NM;
}

/* Postprocessing */
/* Implicit VXLAN settings, which can be deduced from parsed data. */
if (npp->current.netdef->type == NETPLAN_DEF_TYPE_TUNNEL &&
Expand Down
Loading