From: Christoph Heiss <c.heiss@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH installer] proxinstall: replace usage of hacky `mngmt_nic_id` config option
Date: Mon, 24 Mar 2025 14:19:58 +0100 [thread overview]
Message-ID: <20250324132000.770784-2-c.heiss@proxmox.com> (raw)
The option was more or less a hack from the beginning anyway, introduced
during the split of the GUI and the installation configuration.
The required information is already there from `mngmt_nic` - which
carries the name of the network interface - and is easily reused to
replace the functionality.
In short, the `mngmt_nic_id` setting was only used to check whether
another NIC was selected, avoiding needless updates to the IP address
and mask textboxes.
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
---
Proxmox/Install/Config.pm | 6 ------
proxinstall | 9 ++++-----
2 files changed, 4 insertions(+), 11 deletions(-)
diff --git a/Proxmox/Install/Config.pm b/Proxmox/Install/Config.pm
index b3a257e..0adb019 100644
--- a/Proxmox/Install/Config.pm
+++ b/Proxmox/Install/Config.pm
@@ -102,9 +102,6 @@ my sub init_cfg {
# network related
mngmt_nic => undef,
- # FIXME: fix call sites and remove below, it's just an ugly relict of GTK GUI and time
- # pressure on creating the single source of truth for installation config
- mngmt_nic_id => undef,
hostname => undef,
domain => undef,
cidr => undef,
@@ -248,9 +245,6 @@ sub get_root_ssh_keys { return get('root_ssh_keys'); }
sub set_mngmt_nic { set_key('mngmt_nic', $_[0]); }
sub get_mngmt_nic { return get('mngmt_nic'); }
-sub set_mngmt_nic_id { set_key('mngmt_nic_id', $_[0]); }
-sub get_mngmt_nic_id { return get('mngmt_nic_id'); }
-
sub set_hostname { set_key('hostname', $_[0]); }
sub get_hostname { return get('hostname'); }
diff --git a/proxinstall b/proxinstall
index fe7e29f..9bbd2f9 100755
--- a/proxinstall
+++ b/proxinstall
@@ -377,11 +377,11 @@ sub create_ipconf_view {
my $current = shift;
my $new = $device_active_map->{$current->get_active()};
- my $selected = Proxmox::Install::Config::get_mngmt_nic_id();
- return if defined($selected) && $new eq $selected;
-
- Proxmox::Install::Config::set_mngmt_nic_id($new);
my $iface = $ipconf->{ifaces}->{$new};
+
+ my $selected = Proxmox::Install::Config::get_mngmt_nic();
+ return if defined($selected) && $iface->{name} eq $selected;
+
Proxmox::Install::Config::set_mngmt_nic($iface->{name});
$ipconf_entry_addr->set_text($iface->{inet}->{addr} || $iface->{inet6}->{addr})
if $iface->{inet}->{addr} || $iface->{inet6}->{addr};
@@ -414,7 +414,6 @@ sub create_ipconf_view {
$initial_active_device_pos = $device_active_reverse_map->{$nic};
} elsif ($initial_active_device_pos >= 0) {
my $iface_id = $device_active_map->{$initial_active_device_pos};
- Proxmox::Install::Config::set_mngmt_nic_id($iface_id);
my $iface = $ipconf->{ifaces}->{$iface_id};
Proxmox::Install::Config::set_mngmt_nic($iface->{name});
}
--
2.48.1
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next reply other threads:[~2025-03-24 13:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-24 13:19 Christoph Heiss [this message]
2025-04-04 8:33 ` [pve-devel] applied: " Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250324132000.770784-2-c.heiss@proxmox.com \
--to=c.heiss@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal