[pve-devel] applied: [PATCH manager] add 'default' as default name

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Jun 4 17:56:07 CEST 2018


On 5/30/18 10:52 AM, Dominik Csapak wrote:
> else we get a perl error that $account_name is not defined, if we don't
> give a name (which is allowed and the documented default name is 'default')
> 
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
>  PVE/API2/ACMEAccount.pm | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/PVE/API2/ACMEAccount.pm b/PVE/API2/ACMEAccount.pm
> index 31c157d9..5e06024f 100644
> --- a/PVE/API2/ACMEAccount.pm
> +++ b/PVE/API2/ACMEAccount.pm
> @@ -157,7 +157,7 @@ __PACKAGE__->register_method ({
>  my $update_account = sub {
>      my ($param, $msg, %info) = @_;
>  
> -    my $account_name = extract_param($param, 'name');
> +    my $account_name = extract_param($param, 'name') // 'default';
>      my $account_file = "${acme_account_dir}/${account_name}";
>  
>      raise_param_exc({'name' => "ACME account config file '${account_name}' does not exist."})
> @@ -265,7 +265,7 @@ __PACKAGE__->register_method ({
>      code => sub {
>  	my ($param) = @_;
>  
> -	my $account_name = extract_param($param, 'name');
> +	my $account_name = extract_param($param, 'name') // 'default';
>  	my $account_file = "${acme_account_dir}/${account_name}";
>  
>  	raise_param_exc({'name' => "ACME account config file '${account_name}' does not exist."})
> 

applied, with reworded commit message, was confusing for me (it wasn't
helping that the default for the account name is 'default' ^^)




More information about the pve-devel mailing list