[pve-devel] [PATCH pve-zsync 06/11] remove now unnecessary if($disk)

Wolfgang Bumiller w.bumiller at proxmox.com
Mon Sep 28 11:40:07 CEST 2015


---
 pve-zsync | 42 ++++++++++++++++++++----------------------
 1 file changed, 20 insertions(+), 22 deletions(-)

diff --git a/pve-zsync b/pve-zsync
index dfb3050..d784d19 100644
--- a/pve-zsync
+++ b/pve-zsync
@@ -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);
-
-	    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 $cmd = "";
+	$cmd .= "ssh root\@$ip " if $ip;
+	$cmd .= "pvesm path $stor$disk";
+	my $path = run_cmd($cmd);
+
+	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";
 	}
     }
 
-- 
2.1.4




More information about the pve-devel mailing list