Repository: mesos
Updated Branches:
  refs/heads/master 038f4ee96 -> 988bab82f


Improved logging for disk resources.

For CSI disk resources, the root path is redundunt since it can be
derived from the source ID, so we print the root path only for non-CSI
disk resources.

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


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

Branch: refs/heads/master
Commit: 988bab82fdad15bdccb8999e939ac9ed32d89c80
Parents: 038f4ee
Author: Chun-Hung Hsiao <chhs...@mesosphere.io>
Authored: Thu Feb 8 17:52:49 2018 -0800
Committer: Jie Yu <yujie....@gmail.com>
Committed: Thu Feb 8 17:52:49 2018 -0800

----------------------------------------------------------------------
 src/common/resources.cpp | 8 ++++----
 src/v1/resources.cpp     | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/988bab82/src/common/resources.cpp
----------------------------------------------------------------------
diff --git a/src/common/resources.cpp b/src/common/resources.cpp
index 262dcfb..a0c2924 100644
--- a/src/common/resources.cpp
+++ b/src/common/resources.cpp
@@ -2133,14 +2133,14 @@ ostream& operator<<(ostream& stream, const 
Resource::DiskInfo::Source& source)
       return stream
         << "MOUNT"
         << ((source.has_id() || source.has_profile())
-              ? "(" + source.id() + "," + source.profile() + ")" : "")
-        << (source.mount().has_root() ? ":" + source.mount().root() : "");
+              ? "(" + source.id() + "," + source.profile() + ")"
+              : (source.mount().has_root() ? ":" + source.mount().root() : 
""));
     case Resource::DiskInfo::Source::PATH:
       return stream
         << "PATH"
         << ((source.has_id() || source.has_profile())
-              ? "(" + source.id() + "," + source.profile() + ")" : "")
-        << (source.path().has_root() ? ":" + source.path().root() : "");
+              ? "(" + source.id() + "," + source.profile() + ")"
+              : (source.path().has_root() ? ":" + source.path().root() : ""));
     case Resource::DiskInfo::Source::BLOCK:
       return stream
         << "BLOCK"

http://git-wip-us.apache.org/repos/asf/mesos/blob/988bab82/src/v1/resources.cpp
----------------------------------------------------------------------
diff --git a/src/v1/resources.cpp b/src/v1/resources.cpp
index 06e310f..7fc6cd8 100644
--- a/src/v1/resources.cpp
+++ b/src/v1/resources.cpp
@@ -2144,14 +2144,14 @@ ostream& operator<<(ostream& stream, const 
Resource::DiskInfo::Source& source)
       return stream
         << "MOUNT"
         << ((source.has_id() || source.has_profile())
-              ? "(" + source.id() + "," + source.profile() + ")" : "")
-        << (source.mount().has_root() ? ":" + source.mount().root() : "");
+              ? "(" + source.id() + "," + source.profile() + ")"
+              : (source.mount().has_root() ? ":" + source.mount().root() : 
""));
     case Resource::DiskInfo::Source::PATH:
       return stream
         << "PATH"
         << ((source.has_id() || source.has_profile())
-              ? "(" + source.id() + "," + source.profile() + ")" : "")
-        << (source.path().has_root() ? ":" + source.path().root() : "");
+              ? "(" + source.id() + "," + source.profile() + ")"
+              : (source.path().has_root() ? ":" + source.path().root() : ""));
     case Resource::DiskInfo::Source::BLOCK:
       return stream
         << "BLOCK"

Reply via email to