From: Fabian Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com, pbs-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH/RFC v3 pve-container 1/1] restore: sanitize config: use new warn() function
Date: Thu, 8 Jul 2021 11:14:56 +0200 [thread overview]
Message-ID: <20210708091456.47891-4-f.ebner@proxmox.com> (raw)
In-Reply-To: <20210708091456.47891-1-f.ebner@proxmox.com>
to make it more visible that the task finished with warnings.
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---
Dependency bump for pve-common needed.
No changes from v2.
src/PVE/LXC/Create.pm | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/PVE/LXC/Create.pm b/src/PVE/LXC/Create.pm
index 82d7ad9..67b4c7a 100644
--- a/src/PVE/LXC/Create.pm
+++ b/src/PVE/LXC/Create.pm
@@ -6,6 +6,7 @@ use File::Basename;
use File::Path;
use Fcntl;
+use PVE::RPCEnvironment;
use PVE::Storage::PBSPlugin;
use PVE::Storage;
use PVE::DataCenterConfig;
@@ -306,6 +307,8 @@ sub restore_configuration_from_proxmox_backup {
sub sanitize_and_merge_config {
my ($conf, $oldconf, $restricted, $unique) = @_;
+ my $rpcenv = PVE::RPCEnvironment::get();
+
foreach my $key (keys %$oldconf) {
next if $key eq 'digest' || $key eq 'rootfs' || $key eq 'snapshots' || $key eq 'unprivileged' || $key eq 'parent';
next if $key =~ /^mp\d+$/; # don't recover mountpoints
@@ -316,12 +319,16 @@ sub sanitize_and_merge_config {
if ($key eq 'lxc' && $restricted) {
my $lxc_list = $oldconf->{'lxc'};
- warn "skipping custom lxc options, restore manually as root:\n";
- warn "--------------------------------\n";
+
+ my $msg = "skipping custom lxc options, restore manually as root:\n";
+ $msg .= "--------------------------------\n";
foreach my $lxc_opt (@$lxc_list) {
- warn "$lxc_opt->[0]: $lxc_opt->[1]\n"
+ $msg .= "$lxc_opt->[0]: $lxc_opt->[1]\n"
}
- warn "--------------------------------\n";
+ $msg .= "--------------------------------";
+
+ $rpcenv->warn($msg);
+
next;
}
--
2.30.2
WARNING: multiple messages have this Message-ID
From: Fabian Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com, pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH/RFC v3 pve-container 1/1] restore: sanitize config: use new warn() function
Date: Thu, 8 Jul 2021 11:14:56 +0200 [thread overview]
Message-ID: <20210708091456.47891-4-f.ebner@proxmox.com> (raw)
In-Reply-To: <20210708091456.47891-1-f.ebner@proxmox.com>
to make it more visible that the task finished with warnings.
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---
Dependency bump for pve-common needed.
No changes from v2.
src/PVE/LXC/Create.pm | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/PVE/LXC/Create.pm b/src/PVE/LXC/Create.pm
index 82d7ad9..67b4c7a 100644
--- a/src/PVE/LXC/Create.pm
+++ b/src/PVE/LXC/Create.pm
@@ -6,6 +6,7 @@ use File::Basename;
use File::Path;
use Fcntl;
+use PVE::RPCEnvironment;
use PVE::Storage::PBSPlugin;
use PVE::Storage;
use PVE::DataCenterConfig;
@@ -306,6 +307,8 @@ sub restore_configuration_from_proxmox_backup {
sub sanitize_and_merge_config {
my ($conf, $oldconf, $restricted, $unique) = @_;
+ my $rpcenv = PVE::RPCEnvironment::get();
+
foreach my $key (keys %$oldconf) {
next if $key eq 'digest' || $key eq 'rootfs' || $key eq 'snapshots' || $key eq 'unprivileged' || $key eq 'parent';
next if $key =~ /^mp\d+$/; # don't recover mountpoints
@@ -316,12 +319,16 @@ sub sanitize_and_merge_config {
if ($key eq 'lxc' && $restricted) {
my $lxc_list = $oldconf->{'lxc'};
- warn "skipping custom lxc options, restore manually as root:\n";
- warn "--------------------------------\n";
+
+ my $msg = "skipping custom lxc options, restore manually as root:\n";
+ $msg .= "--------------------------------\n";
foreach my $lxc_opt (@$lxc_list) {
- warn "$lxc_opt->[0]: $lxc_opt->[1]\n"
+ $msg .= "$lxc_opt->[0]: $lxc_opt->[1]\n"
}
- warn "--------------------------------\n";
+ $msg .= "--------------------------------";
+
+ $rpcenv->warn($msg);
+
next;
}
--
2.30.2
next prev parent reply other threads:[~2021-07-08 9:15 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-08 9:14 [pve-devel] [PATCH-SERIES v3] improve warnings handling in UI and add to PVE Fabian Ebner
2021-07-08 9:14 ` [pbs-devel] " Fabian Ebner
2021-07-08 9:14 ` [pve-devel] [PATCH v3 proxmox-widget-toolkit 1/1] node: tasks: use helper to format status again Fabian Ebner
2021-07-08 9:14 ` [pbs-devel] " Fabian Ebner
2021-07-08 9:50 ` [pve-devel] applied: " Thomas Lamprecht
2021-07-08 9:50 ` [pbs-devel] applied: " Thomas Lamprecht
2021-07-08 9:14 ` [pve-devel] [PATCH v3 proxmox-backup 1/1] ui: tasks: use format_task_status Fabian Ebner
2021-07-08 9:14 ` [pbs-devel] " Fabian Ebner
2021-07-08 9:45 ` [pve-devel] applied: " Thomas Lamprecht
2021-07-08 9:45 ` [pbs-devel] applied: " Thomas Lamprecht
2021-07-08 9:14 ` Fabian Ebner [this message]
2021-07-08 9:14 ` [pbs-devel] [PATCH/RFC v3 pve-container 1/1] restore: sanitize config: use new warn() function Fabian Ebner
2021-10-14 11:05 ` [pve-devel] applied: " Thomas Lamprecht
2021-10-14 11:05 ` [pbs-devel] applied: [pve-devel] " 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=20210708091456.47891-4-f.ebner@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=pbs-devel@lists.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.