]> git.michaelhowe.org Git - packages/a/afs-monitor.git/commitdiff
Fix check_afs_quotas parsing when no volume was given
authorGeorg Sluyterman <georg@sman.dk>
Thu, 10 Jan 2013 03:40:43 +0000 (19:40 -0800)
committerRuss Allbery <rra@stanford.edu>
Thu, 10 Jan 2013 03:40:43 +0000 (19:40 -0800)
The code to parse the output from vos listvol didn't work properly
in the presence of read-only or backup volumes on the partition.

check_afs_quotas

index d3de92de662ee5c797cc764fb1f76263cc47857b..89255f05c0eb6c350d1a0528b32380042b869d22 100755 (executable)
@@ -103,9 +103,9 @@ sub serverinfo {
     my ($volume, %results);
     local $_;
     while (<LVOL>) {
-        if (/^(\S+)\s+\d+ RW\s+(\d+) K\s+On-line\s*$/) {
+        if (/^(\S+)\s+\d+ (RW|RO|BK)\s+(\d+) K\s+On-line\s*$/) {
             $volume = $1;
-            $results{$volume}{size} = $2;
+            $results{$volume}{size} = $3;
         } elsif (/^\s+MaxQuota\s+(\d+) K\s*$/) {
             $results{$volume}{quota} = $1 if defined $volume;
         }