aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArne H Juul <arnej27959@users.noreply.github.com>2018-05-15 15:18:00 +0200
committerGitHub <noreply@github.com>2018-05-15 15:18:00 +0200
commitc415df6fe8911eca6596ffadfca4df6a05e64056 (patch)
treec3c239d18e08dadd09601c60ce140f5f6c812ed1
parent021e51ed5ae627e8724716f47700cae382192c36 (diff)
parent27aba1045144a6bc13399f2ee978046989fb1524 (diff)
Merge pull request #5868 from vespa-engine/arnej/update-error-messages
cosmetic changes to error messages
-rw-r--r--vespalib/src/apps/vespa-detect-hostname/detect_hostname.cpp3
-rw-r--r--vespalib/src/apps/vespa-validate-hostname/validate_hostname.cpp8
2 files changed, 6 insertions, 5 deletions
diff --git a/vespalib/src/apps/vespa-detect-hostname/detect_hostname.cpp b/vespalib/src/apps/vespa-detect-hostname/detect_hostname.cpp
index a1387c6519d..057d45e8ef5 100644
--- a/vespalib/src/apps/vespa-detect-hostname/detect_hostname.cpp
+++ b/vespalib/src/apps/vespa-detect-hostname/detect_hostname.cpp
@@ -45,6 +45,7 @@ int main(int, char **) {
return 0;
}
}
- fprintf(stderr, "ERROR: failed to detect hostname\n");
+ fprintf(stderr, "FATAL: hostname detection failed\n");
+ // XXX we should explain why it failed
return 1;
}
diff --git a/vespalib/src/apps/vespa-validate-hostname/validate_hostname.cpp b/vespalib/src/apps/vespa-validate-hostname/validate_hostname.cpp
index da4907d4c91..c97927884f8 100644
--- a/vespalib/src/apps/vespa-validate-hostname/validate_hostname.cpp
+++ b/vespalib/src/apps/vespa-validate-hostname/validate_hostname.cpp
@@ -19,7 +19,7 @@ std::set<vespalib::string> make_ip_set() {
vespalib::string normalize(const vespalib::string &hostname) {
vespalib::string canon_name = SocketAddress::normalize(hostname);
if (canon_name != hostname) {
- fprintf(stderr, "warning: host name (%s) is not canonical (canonical host name: %s)\n",
+ fprintf(stderr, "warning: hostname validation: '%s' is not same as canonical hostname '%s'\n",
hostname.c_str(), canon_name.c_str());
}
return canon_name;
@@ -31,7 +31,7 @@ void check_reverse(const vespalib::string &hostname, const SocketAddress &addr)
for (size_t i = 0; !reverse.empty() && (i < 10); ++i) {
if (seen.count(reverse) == 0) {
seen.insert(reverse);
- fprintf(stderr, "warning: conflicting reverse lookup: %s->%s->%s\n",
+ fprintf(stderr, "warning: hostname validation: found conflicting reverse lookup: '%s' -> %s -> '%s'\n",
hostname.c_str(), addr.ip_address().c_str(), reverse.c_str());
}
reverse = addr.reverse_lookup();
@@ -53,14 +53,14 @@ int main(int argc, char **argv) {
auto addr_list = SocketAddress::resolve(80, hostname.c_str());
if (addr_list.empty()) {
valid = false;
- fprintf(stderr, "ERROR: host name (%s) could not be resolved\n",
+ fprintf(stderr, "FATAL: hostname validation failed: '%s' could not be resolved\n",
hostname.c_str());
}
for (const SocketAddress &addr: addr_list) {
vespalib::string ip_addr = addr.ip_address();
if (my_ip_set.count(ip_addr) == 0) {
valid = false;
- fprintf(stderr, "ERROR: host name (%s) resolves to ip address not owned by this host (%s)\n",
+ fprintf(stderr, "FATAL: hostname validation failed: '%s' resolves to ip address not owned by this host (%s)\n",
hostname.c_str(), ip_addr.c_str());
} else {
check_reverse(hostname, addr);