api/acme: fallback to default for account name parameter

We defined 'default' as fallback default value for the optional
pve-acme-account-name standard option but did not honored that.

Thus we got a perl error ($account_name not defined) if we did not
passed a name. Fix that by actually falling back to 'default' in this
case.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Dominik Csapak 2018-05-30 10:52:19 +02:00 committed by Thomas Lamprecht
parent 3e0576d151
commit 05df07b3db

View File

@ -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."})