PBSPlugin: Add print_volid helper
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
committed by
Thomas Lamprecht
parent
35a3953213
commit
8602fd5646
@ -87,6 +87,14 @@ sub pbs_get_password {
|
|||||||
return PVE::Tools::file_read_firstline($pwfile);
|
return PVE::Tools::file_read_firstline($pwfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub print_volid {
|
||||||
|
my ($storeid, $btype, $bid, $btime) = @_;
|
||||||
|
|
||||||
|
my $time_str = strftime("%FT%TZ", gmtime($btime));
|
||||||
|
my $volname = "backup/${btype}/${bid}/${time_str}";
|
||||||
|
|
||||||
|
return "${storeid}:${volname}";
|
||||||
|
}
|
||||||
|
|
||||||
sub run_raw_client_cmd {
|
sub run_raw_client_cmd {
|
||||||
my ($scfg, $storeid, $client_cmd, $param, %opts) = @_;
|
my ($scfg, $storeid, $client_cmd, $param, %opts) = @_;
|
||||||
@ -293,10 +301,7 @@ sub list_volumes {
|
|||||||
next if $bid !~ m/^\d+$/;
|
next if $bid !~ m/^\d+$/;
|
||||||
next if defined($vmid) && $bid ne $vmid;
|
next if defined($vmid) && $bid ne $vmid;
|
||||||
|
|
||||||
my $btime = strftime("%FT%TZ", gmtime($epoch));
|
my $volid = print_volid($storeid, $btype, $bid, $epoch);
|
||||||
my $volname = "backup/${btype}/${bid}/${btime}";
|
|
||||||
|
|
||||||
my $volid = "$storeid:$volname";
|
|
||||||
|
|
||||||
my $info = {
|
my $info = {
|
||||||
volid => $volid,
|
volid => $volid,
|
||||||
|
|||||||
Reference in New Issue
Block a user