[pve-devel] [manager 2/6] Pass parameters for use in plugin.

Fabian Grünbichler f.gruenbichler at proxmox.com
Fri Oct 18 11:23:18 CEST 2019


On October 14, 2019 1:08 pm, Wolfgang Link wrote:
> The node config is required to determine the plugin
> and possibly to pass plugin specific parameters.
> ---
>  PVE/API2/ACME.pm | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/PVE/API2/ACME.pm b/PVE/API2/ACME.pm
> index b1bb6261..2c05db9b 100644
> --- a/PVE/API2/ACME.pm
> +++ b/PVE/API2/ACME.pm
> @@ -47,7 +47,8 @@ __PACKAGE__->register_method ({
>      }});
>  
>  my $order_certificate = sub {
> -    my ($acme, $domains) = @_;
> +    my ($acme, $node_config) = @_;

this is not the node config, but just the acme part of it? ideally, we 
would just pass the plugin instance ID in addition to $domains, and be 
done with it?

> +    my $domains = $node_config->{domains};
>      print "Placing ACME order\n";
>      my ($order_url, $order) = $acme->new_order($domains);
>      print "Order URL: $order_url\n";
> @@ -189,7 +190,7 @@ __PACKAGE__->register_method ({
>  	    print "Loading ACME account details\n";
>  	    $acme->load();
>  
> -	    my ($cert, $key) = $order_certificate->($acme, $acme_node_config->{domains});
> +	    my ($cert, $key) = $order_certificate->($acme, $acme_node_config);
>  
>  	    my $code = sub {
>  		print "Setting pveproxy certificate and key\n";
> @@ -265,7 +266,7 @@ __PACKAGE__->register_method ({
>  	    print "Loading ACME account details\n";
>  	    $acme->load();
>  
> -	    my ($cert, $key) = $order_certificate->($acme, $acme_node_config->{domains});
> +	    my ($cert, $key) = $order_certificate->($acme, $acme_node_config);
>  
>  	    my $code = sub {
>  		print "Setting pveproxy certificate and key\n";
> -- 
> 2.20.1
> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
> 
> 




More information about the pve-devel mailing list