public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
	Christian Ebner <c.ebner@proxmox.com>
Subject: Re: [pve-devel] [PATCH v2 storage] plugin: handle invalid storage types
Date: Mon, 21 Aug 2023 14:11:41 +0200	[thread overview]
Message-ID: <36a2cab5-da40-6650-38cf-f5340aeff1c4@proxmox.com> (raw)
In-Reply-To: <20230621134700.29199-1-c.ebner@proxmox.com>

Am 21.06.23 um 15:47 schrieb Christian Ebner:
> Warn and skip if a storage with unknown storage type is encountered.
> This might happen by manually editing the storage config.
> 

or having used a third-party plugin in the past.

> Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
> ---
> Changes since v1:
>   - v1 contained the wrong diff
> 
>  src/PVE/Storage/Plugin.pm | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/PVE/Storage/Plugin.pm b/src/PVE/Storage/Plugin.pm
> index 9d3b1ae..732f27e 100644
> --- a/src/PVE/Storage/Plugin.pm
> +++ b/src/PVE/Storage/Plugin.pm
> @@ -518,6 +518,10 @@ sub parse_config {
>      foreach my $storeid (keys %$ids) {
>  	my $d = $ids->{$storeid};
>  	my $type = $d->{type};
> +	if (!$type) {
> +	    warn "invalid storage type for '$storeid'\n";
> +	    next;
> +	}
>  

Isn't this already done by the parent parser in SectionConfig.pm? At
least I get a

> file /etc/pve/storage.cfg line 55 (skip section 'bar'): unsupported type 'foo'

and no other errors with an invalid entry using pvesm status.




      reply	other threads:[~2023-08-21 12:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-21 13:47 Christian Ebner
2023-08-21 12:11 ` Fiona Ebner [this message]

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=36a2cab5-da40-6650-38cf-f5340aeff1c4@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=c.ebner@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