You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by tn...@apache.org on 2016/04/01 01:48:17 UTC
[2/3] mesos git commit: Fixed minor style cleanups to docker health
check code.
Fixed minor style cleanups to docker health check code.
Minor cleanups around:
- Remove periods at end of cerr/cout messages.
- Line spacings.
- A few of the `string` variables can be made `const`.
Review: https://reviews.apache.org/r/45556/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/3b42c0bb
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/3b42c0bb
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/3b42c0bb
Branch: refs/heads/master
Commit: 3b42c0bb057c4651cad0342e3d1507de8caa7769
Parents: b6851df
Author: Anand Mazumdar <ma...@gmail.com>
Authored: Thu Mar 31 16:35:28 2016 -0700
Committer: Timothy Chen <tn...@apache.org>
Committed: Thu Mar 31 16:35:28 2016 -0700
----------------------------------------------------------------------
src/docker/executor.cpp | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/3b42c0bb/src/docker/executor.cpp
----------------------------------------------------------------------
diff --git a/src/docker/executor.cpp b/src/docker/executor.cpp
index 21453c0..a9ed8c2 100644
--- a/src/docker/executor.cpp
+++ b/src/docker/executor.cpp
@@ -383,6 +383,7 @@ private:
// "docker exec" require docker version greater than 1.3.0.
Try<Nothing> validateVersion =
docker->validateVersion(Version(1, 3, 0));
+
if (validateVersion.isError()) {
cerr << "Unable to launch health process: "
<< validateVersion.error() << endl;
@@ -397,7 +398,7 @@ private:
if (command.shell()) {
if (!command.has_value()) {
cerr << "Unable to launch health process: "
- << "Shell command is not specified." << endl;
+ << "Shell command is not specified" << endl;
return;
}
@@ -409,11 +410,12 @@ private:
} else {
if (!command.has_value()) {
cerr << "Unable to launch health process: "
- << "Executable path is not specified." << endl;
+ << "Executable path is not specified" << endl;
return;
}
argv.push_back(command.value());
+
foreach (const string& argument, command.arguments()) {
argv.push_back(argument);
}
@@ -425,22 +427,24 @@ private:
healthCheck.mutable_command()->CopyFrom(command);
} else {
cerr << "Unable to launch health process: "
- << "Only command health check is supported now." << endl;
+ << "Only command health check is supported now" << endl;
return;
}
JSON::Object json = JSON::protobuf(healthCheck);
+ const string path = path::join(healthCheckDir, "mesos-health-check");
+
// Launch the subprocess using 'exec' style so that quotes can
// be properly handled.
vector<string> argv;
- string path = path::join(healthCheckDir, "mesos-health-check");
argv.push_back(path);
argv.push_back("--executor=" + stringify(self()));
argv.push_back("--health_check_json=" + stringify(json));
argv.push_back("--task_id=" + task.task_id().value());
- string cmd = strings::join(" ", argv);
+ const string cmd = strings::join(" ", argv);
+
cout << "Launching health check process: " << cmd << endl;
Try<Subprocess> healthProcess =