set user/pw validation if defined rather than just implicit true
7ab29879
Hari Sekhon
committed
1 changed file
check_mongodb_master.pl
/check_mongodb_master.pl-2+2
/check_mongodb_master.pl
Add comment 39 get_options();
Add comment 40
Add comment 41 $hosts = validate_mongo_hosts($host);
Add comment 42 Minus  $user = validate_user($user);
Add comment 43 Minus  $password = validate_password($password) if $password;
Add comment 42 Plus  $user = validate_user($user) if defined($user);
Add comment 43 Plus  $password = validate_password($password) if defined($password);
Add comment 44 if(scalar @hosts > 1){
Add comment 45 $expected_master or usage "must specify --expected-master if specifying more than one host to connect to in the replica set";
Add comment 46 }