use get_repository from PVE::PBSClient

this fixes the issue that we did not generate the correct repository
url for pbs storages that contained an ipv6 address or a port

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2020-12-03 12:43:40 +01:00 committed by Thomas Lamprecht
parent 012b520e5b
commit fbec3f894a
2 changed files with 4 additions and 9 deletions

View File

@ -34,6 +34,7 @@ use PVE::GuestHelpers qw(safe_string_ne safe_num_ne safe_boolean_ne);
use PVE::INotify;
use PVE::JSONSchema qw(get_standard_option parse_property_string);
use PVE::ProcFSTools;
use PVE::PBSClient;
use PVE::RPCEnvironment;
use PVE::Storage;
use PVE::SysFSTools;
@ -6058,13 +6059,10 @@ sub restore_proxmox_backup_archive {
my ($storeid, $volname) = PVE::Storage::parse_volume_id($archive);
my $scfg = PVE::Storage::storage_config($storecfg, $storeid);
my $server = $scfg->{server};
my $datastore = $scfg->{datastore};
my $username = $scfg->{username} // 'root@pam';
my $fingerprint = $scfg->{fingerprint};
my $keyfile = PVE::Storage::PBSPlugin::pbs_encryption_key_file_name($storecfg, $storeid);
my $repo = "$username\@$server:$datastore";
my $repo = PVE::PBSClient::get_repository($scfg);
# This is only used for `pbs-restore`!
my $password = PVE::Storage::PBSPlugin::pbs_get_password($scfg, $storeid);

View File

@ -14,6 +14,7 @@ use PVE::Cluster qw(cfs_read_file);
use PVE::INotify;
use PVE::IPCC;
use PVE::JSONSchema;
use PVE::PBSClient;
use PVE::QMPClient;
use PVE::Storage::Plugin;
use PVE::Storage::PBSPlugin;
@ -473,12 +474,8 @@ sub archive_pbs {
my $starttime = time();
my $server = $scfg->{server};
my $datastore = $scfg->{datastore};
my $username = $scfg->{username} // 'root@pam';
my $fingerprint = $scfg->{fingerprint};
my $repo = "$username\@$server:$datastore";
my $repo = PVE::PBSClient::get_repository($scfg);
my $password = PVE::Storage::PBSPlugin::pbs_get_password($scfg, $opts->{storage});
my $keyfile = PVE::Storage::PBSPlugin::pbs_encryption_key_file_name($scfg, $opts->{storage});