Changeset d1526ca817ef305f15a4f6418c2699bee9663f51

Show
Ignore:
Timestamp:
04/23/10 20:07:11 (5 years ago)
Author:
Mark Harrison <mark@omniti.com>
git-committer:
Mark Harrison <mark@omniti.com> 1272053231 +0000
git-parent:

[117de5423d008dc004459bff76cfcd44a3ab4068]

git-author:
Mark Harrison <mark@omniti.com> 1272053231 +0000
Message:

Change modules to use die instead of manually returning an error metric

git-svn-id: https://labs.omniti.com/resmon/branches/resmon2@314 8c0face9-b7db-6ec6-c4b3-d5f7145c7d55

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lib/Core/DiskFree.pm

    rd29cd18 rd1526ca  
    100100    } else { 
    101101        # We couldn't get the free space 
    102         return { 
    103             "error" => ["Unable to get free space", "s"] 
    104         } 
     102        die "Unable to get free space\n"; 
    105103    } 
    106104}; 
  • lib/Core/DiskInodes.pm

    rfd93a8d rd1526ca  
    118118    } else { 
    119119        # We couldn't match the output line 
    120         return { 
    121             "error" => ["Unable to get free inode count", "s"] 
    122         } 
     120        die "Unable to get free inode count\n"; 
    123121    } 
    124122}; 
  • lib/Core/Pgrep.pm

    r4cff28c rd1526ca  
    7575 
    7676    my $count = run_command("$pgrep_path", "-c$full", "$config->{pattern}"); 
    77     if (!defined($count)) { 
    78         return { 
    79             "error" => ["Unable to run pgrep command", "s"] 
    80         } 
    81     } 
     77    die "Unable to run pgrep command\n" if (!defined($count)); 
    8278    chomp $count; 
    8379 
     
    8985        # We didn't get a count as expected. This can happen if you didn't 
    9086        # provide a pattern or something else went wrong. 
    91         return { 
    92             "error" => ["Pgrep gave unexpected output: $count", "s"] 
    93         }; 
     87        die "Pgrep gave unexpected output: $count\n"; 
    9488    }; 
    9589};