From 9bc4ed641794ddfe057aeaf308cb50ec3e9acf15 Mon Sep 17 00:00:00 2001 From: Tamar Ben-Shachar Date: Thu, 7 May 2015 17:11:27 -0700 Subject: [PATCH] dcos-568 verify that Marathon 0.8.0 or later is installed --- dcos/marathon.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dcos/marathon.py b/dcos/marathon.py index 18946aa..9d035f5 100644 --- a/dcos/marathon.py +++ b/dcos/marathon.py @@ -1,4 +1,5 @@ import json +from distutils.version import LooseVersion from dcos import http, util from dcos.errors import DCOSException, DefaultError, Error @@ -69,6 +70,12 @@ class Client(object): self._host = host self._port = port + version = LooseVersion(self.get_about()["version"]) + if version < LooseVersion("0.8.0"): + msg = ("The configured Marathon with version {} is outdated. " + + "Please use version 0.8.0 or later.").format(version) + raise DCOSException(msg) + def _create_url(self, path): """Creates the url from the provided path.