[pve-devel] applied: [PATCH manager] fix #1326: allow multiple status server definitions per type

Thomas Lamprecht t.lamprecht at proxmox.com
Thu Apr 11 09:29:56 CEST 2019


On 4/10/19 2:49 PM, Dominik Csapak wrote:
> we allow an id like storage.cfg but leave it optional (so we do not
> break existing configs):
> 
>  influxdb: name
> 
> so that one can export the data to multiple servers of the same type
> 
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
>  PVE/Status/Plugin.pm | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/PVE/Status/Plugin.pm b/PVE/Status/Plugin.pm
> index ff7af896..d348699f 100644
> --- a/PVE/Status/Plugin.pm
> +++ b/PVE/Status/Plugin.pm
> @@ -44,13 +44,17 @@ sub private {
>  sub parse_section_header {
>      my ($class, $line) = @_;
>  
> -    if ($line =~ m/^(\S+):\s*$/) {
> +    if ($line =~ m/^(\S+):\s*(\S+)?\s*$/) {
>  	my $type = lc($1);
> +	my $id = $2 // $type;
>  	my $errmsg = undef; # set if you want to skip whole section
> -	eval { PVE::JSONSchema::pve_verify_configid($type); };
> +	eval {
> +	    PVE::JSONSchema::pve_verify_configid($type);
> +	    PVE::JSONSchema::pve_verify_configid($id);
> +	};
>  	$errmsg = $@ if $@;
>  	my $config = {}; # to return additional attributes
> -	return ($type, $type, $errmsg, $config);
> +	return ($type, $id, $errmsg, $config);
>      }
>      return undef;
>  }
> 

applied, thanks!




More information about the pve-devel mailing list