aboutsummaryrefslogtreecommitdiffstats
path: root/configutil
diff options
context:
space:
mode:
authorArne H Juul <arnej@yahoo-inc.com>2016-07-06 13:00:19 +0200
committerArne H Juul <arnej@yahoo-inc.com>2016-07-06 13:00:19 +0200
commitf4de1d79cc6c4eda2272229f009208d729432f9a (patch)
tree5d3c30e894e31634cbfb6da82fb6339810f8e870 /configutil
parent3d1f7c6348c179d653e5b5c26df88e2f0636ac05 (diff)
use new method in Defaults instead of perl script
Diffstat (limited to 'configutil')
-rw-r--r--configutil/src/apps/configstatus/main.cpp19
-rw-r--r--configutil/src/apps/modelinspect/main.cpp19
2 files changed, 10 insertions, 28 deletions
diff --git a/configutil/src/apps/configstatus/main.cpp b/configutil/src/apps/configstatus/main.cpp
index b3fb611ffa4..6cc1b8f1240 100644
--- a/configutil/src/apps/configstatus/main.cpp
+++ b/configutil/src/apps/configstatus/main.cpp
@@ -79,21 +79,12 @@ Application::Main(void)
vespalib::string
Application::getSources(void)
{
- vespalib::string cmd = vespa::Defaults::vespaHome();
- cmd.append("libexec/vespa/vespa-config.pl -configsources");
- FILE* fp = popen(cmd.c_str(), "r");
- if (fp == 0) {
- std::cerr << "Failed to run " << cmd << " ("
- << errno << "): " << strerror(errno) << "\n";
- return "";
+ vespalib::string specs;
+ for (std::string v : vespa::Defaults::vespaConfigSourcesRpcAddrs()) {
+ if (! specs.empty()) specs += ",";
+ specs += v;
}
- vespalib::asciistream specs;
- char data[500];
- while (fgets(data, 500, fp) != 0) {
- specs << &data[0] << "\n";
- }
- pclose(fp);
- return specs.str();
+ return specs;
}
int
diff --git a/configutil/src/apps/modelinspect/main.cpp b/configutil/src/apps/modelinspect/main.cpp
index f5a1e28e218..592bc8bdf8b 100644
--- a/configutil/src/apps/modelinspect/main.cpp
+++ b/configutil/src/apps/modelinspect/main.cpp
@@ -63,21 +63,12 @@ Application::parseOpts()
vespalib::string
Application::getSources(void)
{
- vespalib::string cmd = vespa::Defaults::vespaHome();
- cmd.append("libexec/vespa/vespa-config.pl -configsources");
- FILE* fp = popen(cmd.c_str(), "r");
- if (fp == 0) {
- std::cerr << "Failed to run " << cmd << " ("
- << errno << "): " << strerror(errno) << "\n";
- return "";
+ vespalib::string specs;
+ for (std::string v : vespa::Defaults::vespaConfigSourcesRpcAddrs()) {
+ if (! specs.empty()) specs += ",";
+ specs += v;
}
- vespalib::asciistream specs;
- char data[500];
- while (fgets(data, 500, fp) != 0) {
- specs << &data[0] << "\n";
- }
- pclose(fp);
- return specs.str();
+ return specs;
}
void