Repository: mesos Updated Branches: refs/heads/master 26ce6b595 -> c52f5bf34
Fixed network isolator crash when network interface is not found. It's not an error if network interface cannot be found, and None is returned by lookup functions as a result in this case. This fix ensures that None is properly handled, when composing an error messge in network isolator. Review: https://reviews.apache.org/r/58209/ Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/c52f5bf3 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/c52f5bf3 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/c52f5bf3 Branch: refs/heads/master Commit: c52f5bf348f9deca587359d4af80d7b325b6728f Parents: 26ce6b5 Author: Dmitry Zhuk <[email protected]> Authored: Thu Apr 6 16:35:11 2017 -0700 Committer: Jie Yu <[email protected]> Committed: Thu Apr 6 16:35:11 2017 -0700 ---------------------------------------------------------------------- .../containerizer/mesos/isolators/network/port_mapping.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/c52f5bf3/src/slave/containerizer/mesos/isolators/network/port_mapping.cpp ---------------------------------------------------------------------- diff --git a/src/slave/containerizer/mesos/isolators/network/port_mapping.cpp b/src/slave/containerizer/mesos/isolators/network/port_mapping.cpp index dfa71fb..433299c 100644 --- a/src/slave/containerizer/mesos/isolators/network/port_mapping.cpp +++ b/src/slave/containerizer/mesos/isolators/network/port_mapping.cpp @@ -1553,7 +1553,8 @@ Try<Isolator*> PortMappingIsolatorProcess::create(const Flags& flags) // eth0 is not specified in the flag and we did not get a valid // eth0 from the library. return Error( - "Network Isolator failed to find a public interface: " + eth0.error()); + "Network Isolator failed to find a public interface: " + + (eth0.isError() ? eth0.error() : "does not have a public interface")); } LOG(INFO) << "Using " << eth0.get() << " as the public interface"; @@ -1578,7 +1579,8 @@ Try<Isolator*> PortMappingIsolatorProcess::create(const Flags& flags) // lo is not specified in the flag and we did not get a valid // lo from the library. return Error( - "Network Isolator failed to find a loopback interface: " + lo.error()); + "Network Isolator failed to find a loopback interface: " + + (lo.isError() ? lo.error() : "does not have a loopback interface")); } LOG(INFO) << "Using " << lo.get() << " as the loopback interface";
