aboutsummaryrefslogtreecommitdiffstats
path: root/vespaclient
diff options
context:
space:
mode:
authorArne Juul <arnej@yahoo-inc.com>2018-05-16 06:49:56 +0000
committerArne Juul <arnej@yahoo-inc.com>2018-05-16 07:32:17 +0000
commita51021d1a2e737deefde42777e58d8e364af91ad (patch)
tree51a80363a1a19af91758c4322340ad5ea3ca4786 /vespaclient
parent8cabaa3da3bdf7a1de5cbf320772edd676763b26 (diff)
update bootstrap
Diffstat (limited to 'vespaclient')
-rwxr-xr-xvespaclient/src/perl/bin/GetClusterState.pl11
-rwxr-xr-xvespaclient/src/perl/bin/GetNodeState.pl11
-rwxr-xr-xvespaclient/src/perl/bin/SetNodeState.pl11
3 files changed, 21 insertions, 12 deletions
diff --git a/vespaclient/src/perl/bin/GetClusterState.pl b/vespaclient/src/perl/bin/GetClusterState.pl
index 155db87f34e..aee988c74ff 100755
--- a/vespaclient/src/perl/bin/GetClusterState.pl
+++ b/vespaclient/src/perl/bin/GetClusterState.pl
@@ -53,14 +53,17 @@ sub findhome {
}
sub findhost {
- $ENV{'PATH'} = $ENV{'VESPA_HOME'} . '/bin:' . $ENV{'PATH'};
my $tmp = $ENV{'VESPA_HOSTNAME'};
+ my $bin = $ENV{'VESPA_HOME'} . "/bin";
if (!defined $tmp) {
- $tmp = `vespa-detect-hostname` or die "Could not detect hostname\n";
+ $tmp = `${bin}/vespa-detect-hostname || hostname -f || hostname || echo "localhost"`;
chomp $tmp;
}
- system("vespa-validate-hostname $tmp");
- ( $? == 0 ) or die "Could not validate hostname\n";
+ my $validate = "${bin}/vespa-validate-hostname";
+ if (-f "${validate}") {
+ system("${validate} $tmp");
+ ( $? == 0 ) or die "Could not validate hostname\n";
+ }
return $tmp;
}
diff --git a/vespaclient/src/perl/bin/GetNodeState.pl b/vespaclient/src/perl/bin/GetNodeState.pl
index 1e048df4b40..c303b94be90 100755
--- a/vespaclient/src/perl/bin/GetNodeState.pl
+++ b/vespaclient/src/perl/bin/GetNodeState.pl
@@ -53,14 +53,17 @@ sub findhome {
}
sub findhost {
- $ENV{'PATH'} = $ENV{'VESPA_HOME'} . '/bin:' . $ENV{'PATH'};
my $tmp = $ENV{'VESPA_HOSTNAME'};
+ my $bin = $ENV{'VESPA_HOME'} . "/bin";
if (!defined $tmp) {
- $tmp = `vespa-detect-hostname` or die "Could not detect hostname\n";
+ $tmp = `${bin}/vespa-detect-hostname || hostname -f || hostname || echo "localhost"`;
chomp $tmp;
}
- system("vespa-validate-hostname $tmp");
- ( $? == 0 ) or die "Could not validate hostname\n";
+ my $validate = "${bin}/vespa-validate-hostname";
+ if (-f "${validate}") {
+ system("${validate} $tmp");
+ ( $? == 0 ) or die "Could not validate hostname\n";
+ }
return $tmp;
}
diff --git a/vespaclient/src/perl/bin/SetNodeState.pl b/vespaclient/src/perl/bin/SetNodeState.pl
index 77ebf9a2456..b1fc32c02b3 100755
--- a/vespaclient/src/perl/bin/SetNodeState.pl
+++ b/vespaclient/src/perl/bin/SetNodeState.pl
@@ -53,14 +53,17 @@ sub findhome {
}
sub findhost {
- $ENV{'PATH'} = $ENV{'VESPA_HOME'} . '/bin:' . $ENV{'PATH'};
my $tmp = $ENV{'VESPA_HOSTNAME'};
+ my $bin = $ENV{'VESPA_HOME'} . "/bin";
if (!defined $tmp) {
- $tmp = `vespa-detect-hostname` or die "Could not detect hostname\n";
+ $tmp = `${bin}/vespa-detect-hostname || hostname -f || hostname || echo "localhost"`;
chomp $tmp;
}
- system("vespa-validate-hostname $tmp");
- ( $? == 0 ) or die "Could not validate hostname\n";
+ my $validate = "${bin}/vespa-validate-hostname";
+ if (-f "${validate}") {
+ system("${validate} $tmp");
+ ( $? == 0 ) or die "Could not validate hostname\n";
+ }
return $tmp;
}