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 2017/08/29 15:55:37 UTC

[02/12] mesos git commit: Used path::absolute to replace some startsWith checks.

Used path::absolute to replace some startsWith checks.

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


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

Branch: refs/heads/master
Commit: 8340b23917a1c6eceefa2fddf5dfc3c446e27933
Parents: 5e179c9
Author: Jie Yu <yu...@gmail.com>
Authored: Thu Aug 24 16:52:29 2017 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Tue Aug 29 08:55:32 2017 -0700

----------------------------------------------------------------------
 src/slave/containerizer/mesos/isolators/filesystem/linux.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/8340b239/src/slave/containerizer/mesos/isolators/filesystem/linux.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolators/filesystem/linux.cpp b/src/slave/containerizer/mesos/isolators/filesystem/linux.cpp
index 5a940e2..bc14324 100644
--- a/src/slave/containerizer/mesos/isolators/filesystem/linux.cpp
+++ b/src/slave/containerizer/mesos/isolators/filesystem/linux.cpp
@@ -466,8 +466,8 @@ Try<vector<CommandInfo>> LinuxFilesystemIsolatorProcess::getPreExecCommands(
     // If both 'host_path' and 'container_path' are relative paths,
     // return an error because the user can just directly access the
     // volume in the work directory.
-    if (!strings::startsWith(volume.host_path(), "/") &&
-        !strings::startsWith(volume.container_path(), "/")) {
+    if (!path::absolute(volume.host_path()) &&
+        !path::absolute(volume.container_path())) {
       return Error(
           "Both 'host_path' and 'container_path' of a volume are relative");
     }
@@ -515,7 +515,7 @@ Try<vector<CommandInfo>> LinuxFilesystemIsolatorProcess::getPreExecCommands(
     // a directory, or the path of a file.
     string target;
 
-    CHECK(strings::startsWith(volume.container_path(), "/"));
+    CHECK(path::absolute(volume.container_path()));
 
     if (containerConfig.has_rootfs()) {
       target = path::join(