You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2014/08/13 08:29:00 UTC

[5/6] git commit: Updated slave http to use the new CommmandInfo.

Updated slave http to use the new CommmandInfo.

Review: https://reviews.apache.org/r/24634


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/955c64a1
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/955c64a1
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/955c64a1

Branch: refs/heads/master
Commit: 955c64a1b91a01a0e0984d2ab48b0a61767f7a82
Parents: 1c48805
Author: Jie Yu <yu...@gmail.com>
Authored: Tue Aug 12 22:11:48 2014 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Tue Aug 12 23:28:29 2014 -0700

----------------------------------------------------------------------
 src/slave/http.cpp | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/955c64a1/src/slave/http.cpp
----------------------------------------------------------------------
diff --git a/src/slave/http.cpp b/src/slave/http.cpp
index 98bdab6..92eb348 100644
--- a/src/slave/http.cpp
+++ b/src/slave/http.cpp
@@ -83,13 +83,26 @@ using process::http::Request;
 JSON::Object model(const CommandInfo& command)
 {
   JSON::Object object;
-  object.values["value"] = command.value();
+
+  if (command.has_shell()) {
+    object.values["shell"] = command.shell();
+  }
+
+  if (command.has_value()) {
+    object.values["value"] = command.value();
+  }
+
+  JSON::Array argv;
+  foreach (const string& arg, command.argv()) {
+    argv.values.push_back(arg);
+  }
+  object.values["argv"] = argv;
 
   if (command.has_environment()) {
     JSON::Object environment;
     JSON::Array variables;
     foreach(const Environment_Variable& variable,
-        command.environment().variables()) {
+            command.environment().variables()) {
       JSON::Object variableObject;
       variableObject.values["name"] = variable.name();
       variableObject.values["value"] = variable.value();