]> git.proxmox.com Git - pve-zsync.git/commitdiff
replace $is_disk with an early check
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Mon, 28 Sep 2015 09:40:05 +0000 (11:40 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 16 Oct 2015 09:00:03 +0000 (11:00 +0200)
pve-zsync

index 33962a6f7f20e160567d2e78e94144c0e762f7ac..dfb383bac599cdf2568b73a7926e7421eb237cba 100644 (file)
--- a/pve-zsync
+++ b/pve-zsync
@@ -692,10 +692,10 @@ sub parse_disks {
        my $line = $1;
 
        next if $line =~ /cdrom|none/;
+       next if $line !~ m/^(?:virtio|ide|scsi|sata)\d+: /;
 
        my $disk = undef;
        my $stor = undef;
-       my $is_disk = $line =~ m/^(virtio|ide|scsi|sata){1}\d+: /;
        if($line =~ m/^(virtio\d+: )(.+:)([A-Za-z0-9\-]+),(.*)$/) {
            $disk = $3;
            $stor = $2;
@@ -708,10 +708,10 @@ sub parse_disks {
        } elsif($line =~ m/^(sata\d+: )(.+:)([A-Za-z0-9\-]+),(.*)$/) {
            $disk = $3;
            $stor = $2;
+       } else {
+           die "disk is not on ZFS Storage\n";
        }
 
-       die "disk is not on ZFS Storage\n" if $is_disk && !$disk;
-
        if($disk) {
            my $cmd = "";
            $cmd .= "ssh root\@$ip " if $ip;