Moved failover timeout validation to stateless FrameworkInfo validation.

This turns the validation of the failover timeout in `FrameworkInfo`
into  a part of `validation::framework::validate()` that performs
all the other validations that depend on `FrameworkInfo` only.

Review: https://reviews.apache.org/r/72964
diff --git a/src/master/master.cpp b/src/master/master.cpp
index d6d3ea7..6c0523d 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -157,8 +157,6 @@
 
 using mesos::scheduler::OfferConstraints;
 
-static bool isValidFailoverTimeout(const FrameworkInfo& frameworkInfo);
-
 
 class SlaveObserver : public ProtobufProcess<SlaveObserver>
 {
@@ -2612,11 +2610,6 @@
     return Error("Framework has been removed");
   }
 
-  if (!isValidFailoverTimeout(frameworkInfo)) {
-    return Error("The framework failover_timeout (" +
-                 stringify(frameworkInfo.failover_timeout()) +
-                 ") is invalid");
-  }
   return Option<Error>::none();
 }
 
@@ -12319,12 +12312,6 @@
 }
 
 
-static bool isValidFailoverTimeout(const FrameworkInfo& frameworkInfo)
-{
-  return Duration::create(frameworkInfo.failover_timeout()).isSome();
-}
-
-
 void Master::Subscribers::send(
     const mesos::master::Event& event,
     const Option<FrameworkInfo>& frameworkInfo,
diff --git a/src/master/validation.cpp b/src/master/validation.cpp
index 5b1bcb5..feeea8e 100644
--- a/src/master/validation.cpp
+++ b/src/master/validation.cpp
@@ -560,13 +560,25 @@
   return None();
 }
 
+
+Option<Error> validateFailoverTimeout(const FrameworkInfo& frameworkInfo)
+{
+  if (Duration::create(frameworkInfo.failover_timeout()).isSome()) {
+    return None();
+  }
+
+  return Error(
+      "The framework failover_timeout (" +
+      stringify(frameworkInfo.failover_timeout()) + ") is invalid");
+}
+
 } // namespace internal {
 
 
 Option<Error> validate(const mesos::FrameworkInfo& frameworkInfo)
 {
   // TODO(jay_guo): This currently only validates the role(s),
-  // framework ID and offer filters, validate more fields!
+  // framework ID, offer filters and failover timeout, validate more fields!
   Option<Error> error = internal::validateRoles(frameworkInfo);
 
   if (error.isSome()) {
@@ -585,6 +597,12 @@
     return error;
   }
 
+  error = internal::validateFailoverTimeout(frameworkInfo);
+
+  if(error.isSome()) {
+    return error;
+  }
+
   return None();
 }