public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com, Mira Limbeck <m.limbeck@proxmox.com>
Subject: Re: [pve-devel] [PATCH manager] report: filter comments in VM/CT configs
Date: Fri, 16 Dec 2022 13:15:49 +0100	[thread overview]
Message-ID: <e93d44a1-806f-82d8-0820-e4a5fb19c778@proxmox.com> (raw)
In-Reply-To: <20221215165700.2061397-1-m.limbeck@proxmox.com>

Am 15.12.22 um 17:57 schrieb Mira Limbeck:
> diff --git a/PVE/Report.pm b/PVE/Report.pm
> index 90b7cb1c..7ebe98f7 100644
> --- a/PVE/Report.pm
> +++ b/PVE/Report.pm
> @@ -5,16 +5,34 @@ use warnings;
>  
>  use PVE::Tools;
>  
> +my sub file2text {
> +    my ($file, $filter) = @_;
> +    my $text = "\n# cat $file\n";
> +
> +    my $contents = PVE::Tools::file_get_contents($file);
> +    if ($filter) {
> +	foreach my $line (split('\n', $contents)) {
> +	    next if $line =~ m/^\s*#/;
> +	    next if $line =~ m/^cipassword/;
> +
Should we rather mask the value instead of dropping the whole line, so
that we can see that /some/ cipassword is set? Might be more relevant
for future filtered options.




  parent reply	other threads:[~2022-12-16 12:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-15 16:57 Mira Limbeck
2022-12-16  9:01 ` Stefan Sterz
2022-12-16 10:31 ` Thomas Lamprecht
2022-12-16 11:14   ` Mira Limbeck
2022-12-16 12:15 ` Fiona Ebner [this message]
2022-12-28 14:18   ` Stefan Sterz
2022-12-30 14:34     ` 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=e93d44a1-806f-82d8-0820-e4a5fb19c778@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=m.limbeck@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