From: Wolfgang Bumiller Date: Mon, 28 Sep 2015 09:40:05 +0000 (+0200) Subject: replace $is_disk with an early check X-Git-Url: https://git.proxmox.com/?p=pve-zsync.git;a=commitdiff_plain;h=845e36d7709984a76112ecc6f81e7bb66b920f06 replace $is_disk with an early check --- diff --git a/pve-zsync b/pve-zsync index 33962a6..dfb383b 100644 --- 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;