Skip to content
Browse files

fixed tests for windows

  • Loading branch information...
1 parent b309b3a commit cf1c812699cc09bcba93f1642550407502f367ad @sni committed Feb 20, 2010
Showing with 13 additions and 6 deletions.
  1. +2 −1 Changes
  2. +11 −5 lib/Monitoring/Generator/TestConfig.pm
View
3 Changes
@@ -1,7 +1,8 @@
Revision history for Perl extension Monitoring::Generator::TestConfig.
-0.27 Sat Jan 9 00:06:51 CET 2010
+0.27 Sat Feb 20 20:29:17 CET 2010
added shinken layout
+ fixed tests for windows
0.26 Fri Jan 8 11:13:16 CET 2010
fixed way of searching for binarys
View
16 lib/Monitoring/Generator/TestConfig.pm
@@ -12,7 +12,7 @@ use Monitoring::Generator::TestConfig::HostCheckData;
use Monitoring::Generator::TestConfig::InitScriptData;
use Monitoring::Generator::TestConfig::P1Data;
-our $VERSION = '0.27_1';
+our $VERSION = '0.27_2';
=head1 NAME
@@ -145,10 +145,16 @@ sub new {
}
# set some defaults
- my $user = getlogin();
- my @userinfo = getpwnam($user);
- my @groupinfo = getgrgid($userinfo[3]);
- my $group = $groupinfo[0];
+ my($user, $group);
+ if($^O eq "MSWin32") {
+ $user = getlogin();
+ $group = "nagios";
+ } else {
+ $user = getlogin();
+ my @userinfo = getpwnam($user);
+ my @groupinfo = getgrgid($userinfo[3]);
+ $group = $groupinfo[0];
+ }
$self->{'user'} = $user unless defined $self->{'user'};
$self->{'group'} = $group unless defined $self->{'group'};

0 comments on commit cf1c812

Please sign in to comment.
Something went wrong with that request. Please try again.