From: Maximiliano Sandoval <m.sandoval@proxmox.com>
To: Jonas Theisen <j.theisen@proxmox.com>
Cc: pve-devel@lists.proxmox.com
Subject: Re: [PATCH pve-manager v2 2/2] fix #8031: write APT proxy config on http_proxy change
Date: Tue, 15 Sep 2026 10:03:03 +0200 [thread overview]
Message-ID: <s8oecev7xhk.fsf@toolbox> (raw)
In-Reply-To: <20260914152423.410631-3-j.theisen@proxmox.com> (Jonas Theisen's message of "Mon, 14 Sep 2026 17:24:12 +0200")
Jonas Theisen <j.theisen@proxmox.com> writes:
> Writes the necessary file for APT if the http_proxy variable
> on the datacenter level is changed.
>
> This reuses the same function from the APT API for a regular
> database update.
>
> Signed-off-by: Jonas Theisen <j.theisen@proxmox.com>
> ---
> PVE/API2/Cluster.pm | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/PVE/API2/Cluster.pm b/PVE/API2/Cluster.pm
> index 4e5efbfd..8529c026 100644
> --- a/PVE/API2/Cluster.pm
> +++ b/PVE/API2/Cluster.pm
> @@ -36,6 +36,7 @@ use PVE::API2::ClusterConfig;
> use PVE::API2::Firewall::Cluster;
> use PVE::API2::HAConfig;
> use PVE::API2::ReplicationConfig;
> +use PVE::API2::APT;
>
> my $have_sdn;
> eval {
> @@ -842,7 +843,11 @@ __PACKAGE__->register_method({
> code => sub {
> my ($param) = @_;
>
> + my $http_proxy_change = 0;
> +
> my $delete = extract_param($param, 'delete');
> + $http_proxy_change = 1
> + if ((defined($param->{http_proxy})) || (defined($delete) && $delete =~ m/\bhttp_proxy\b/ ));
Cosmetic stuff: Please run a 'make tidy' to format this file. the
whitespace before the '))' at the end will probably trigger the
formatter. I don't think you need to use two levels of parenthesis
either on the defined($param->{http_proxy} part, but the formatter won't
fix that automatically.
Regarding the '\b', they look correct to me but I am not sure if this is
necessary. This is not a blocked in any case.
>
> cfs_lock_file(
> 'datacenter.cfg',
> @@ -859,6 +864,10 @@ __PACKAGE__->register_method({
> );
> die $@ if $@;
>
> + if ($http_proxy_change) {
> + PVE::API2::APT::update_apt_proxy_config();
> + }
> +
> return undef;
> },
> });
Other than that, the patch looks good to me.
Reviewed-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
--
Maximiliano
next prev parent reply other threads:[~2026-09-15 8:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-14 15:24 [PATCH pve-manager v2 0/2] fix #8031: Write APT proxy config on http_proxy change Jonas Theisen
2026-09-14 15:24 ` [PATCH pve-manager v2 1/2] fix #8031: factor out APT proxy write from update_database call Jonas Theisen
2026-09-14 15:24 ` [PATCH pve-manager v2 2/2] fix #8031: write APT proxy config on http_proxy change Jonas Theisen
2026-09-15 8:03 ` Maximiliano Sandoval [this message]
2026-09-15 9:18 ` [PATCH pve-manager v2 0/2] fix #8031: Write " Jonas Theisen
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=s8oecev7xhk.fsf@toolbox \
--to=m.sandoval@proxmox.com \
--cc=j.theisen@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