5
0
mirror of git://git.proxmox.com/git/pve-zsync.git synced 2025-03-11 20:58:42 +03:00

remove now unnecessary if($disk)

This commit is contained in:
Wolfgang Bumiller 2015-09-28 11:40:07 +02:00 committed by Dietmar Maurer
parent 4f865f2805
commit b52d13b356

View File

@ -703,29 +703,27 @@ sub parse_disks {
die "disk is not on ZFS Storage\n";
}
if($disk) {
my $cmd = "";
$cmd .= "ssh root\@$ip " if $ip;
$cmd .= "pvesm path $stor$disk";
my $path = run_cmd($cmd);
my $cmd = "";
$cmd .= "ssh root\@$ip " if $ip;
$cmd .= "pvesm path $stor$disk";
my $path = run_cmd($cmd);
if ($path =~ m/^\/dev\/zvol\/(\w+).*(\/$disk)$/) {
if ($path =~ m/^\/dev\/zvol\/(\w+).*(\/$disk)$/) {
my @array = split('/', $1);
$disks->{$num}->{pool} = pop(@array);
$disks->{$num}->{all} = $disks->{$num}->{pool};
if (0 < @array) {
$disks->{$num}->{path} = join('/', @array);
$disks->{$num}->{all} .= "\/$disks->{$num}->{path}";
}
$disks->{$num}->{last_part} = $disk;
$disks->{$num}->{all} .= "\/$disk";
$num++;
} else {
die "ERROR: in path\n";
my @array = split('/', $1);
$disks->{$num}->{pool} = pop(@array);
$disks->{$num}->{all} = $disks->{$num}->{pool};
if (0 < @array) {
$disks->{$num}->{path} = join('/', @array);
$disks->{$num}->{all} .= "\/$disks->{$num}->{path}";
}
$disks->{$num}->{last_part} = $disk;
$disks->{$num}->{all} .= "\/$disk";
$num++;
} else {
die "ERROR: in path\n";
}
}