mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-09-05 12:37:54 +00:00
4844528860
Treating an empty noderes.installnic as "mac" skipped noderes.primarynic: a node that configures only primarynic was installed with a netplan matching on mac.mac that never renamed the interface, and a primarynic holding a MAC address was ignored. The order xCAT uses everywhere else is installnic -> primarynic -> mac.mac, with either attribute allowed to hold an interface name or a MAC address, and xCAT::NetworkUtils::gen_net_boot_params already implements it for the netboot kernel parameters. Resolve it in Perl and hand the template the answer: - xCAT::Template::subiquity_install_netcfg() delegates the order to gen_net_boot_params and returns the netplan set-name (empty when the device is matched by MAC alone) and the address to match on, with mac.mac parsed by xCAT::Utils::parseMacTabEntry so |-separated, !hostname-suffixed entries resolve to THIS node rather than to whichever entry came first. - #SUBIQUITYINSTALLNIC# / #SUBIQUITYINSTALLMAC# render those two values. installnic and primarynic are read blank-okay -- a node that sets neither is normal, and is exactly what "match on mac.mac" means -- while mac.mac stays a required lookup, as it was when the template read it directly. - compute.subiquity.tmpl consumes the resolved values. No part of the fallback, and no mac.mac parsing, is left in shell: it only chooses whether to emit set-name, based on whether a name was resolved. ubuntu_subiquity_installnic.t now passes: the six resolution cases, multi-entry mac.mac, and the netplan the template's own late-command writes for a resolved name and for none. ubuntu_subiquity_template.t asserts the template no longer reads installnic/primarynic or parses MACs itself. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>