Re-deprecated 'webui_hostname' as optional (from required).

We still need to set the 'webui_hostname' field for now in order for
interoperating with code that expects it to be required (e.g., a slave
on an older release). After another deprecation cycle we can either
remove this field entirely or just keep it around as an artifact so
that we don't reuse the ID.

Review: https://reviews.apache.org/r/15214
diff --git a/include/mesos/mesos.proto b/include/mesos/mesos.proto
index d45ee5e..87132af 100644
--- a/include/mesos/mesos.proto
+++ b/include/mesos/mesos.proto
@@ -177,6 +177,10 @@
   repeated Attribute attributes = 5;
   optional SlaveID id = 6;
   optional bool checkpoint = 7 [default = false];
+
+  // Deprecated!
+  optional string webui_hostname = 2;
+  optional int32 webui_port = 4 [default = 8081];
 }
 
 
diff --git a/src/common/type_utils.hpp b/src/common/type_utils.hpp
index 90149d9..3b05751 100644
--- a/src/common/type_utils.hpp
+++ b/src/common/type_utils.hpp
@@ -281,6 +281,8 @@
 
 inline bool operator == (const SlaveInfo& left, const SlaveInfo& right)
 {
+  // NOTE: We don't compare 'webui_hostname' and 'webui_port' since
+  // they're deprecated and do not carry any semantic meaning.
   return left.hostname() == right.hostname() &&
     Resources(left.resources()) == Resources(right.resources()) &&
     internal::Attributes(left.attributes()) ==
diff --git a/src/slave/slave.cpp b/src/slave/slave.cpp
index 06ef786..ddf3710 100644
--- a/src/slave/slave.cpp
+++ b/src/slave/slave.cpp
@@ -234,6 +234,13 @@
   info.mutable_attributes()->MergeFrom(attributes);
   info.set_checkpoint(flags.checkpoint);
 
+  // The required 'webui_hostname' field has been deprecated and
+  // changed to optional for now, but we still need to set it for
+  // interoperating with code that expects it to be required (e.g., an
+  // executor on an older release).
+  // TODO(benh): Remove this after the deprecation cycle.
+  info.set_webui_hostname(hostname);
+
   // Spawn and initialize the isolator.
   // TODO(benh): Seems like the isolator should really be
   // spawned before being passed to the slave.