support core.dcos_url in dcos tasks
This commit is contained in:
@@ -329,12 +329,12 @@ CJdfQ=="""
|
||||
|
||||
def test_install_with_id():
|
||||
args = ['--app-id=chronos-1']
|
||||
stdout = (b"""Installing package [chronos] version [2.3.3] with app """
|
||||
stdout = (b"""Installing package [chronos] version [2.3.4] with app """
|
||||
b"""id [chronos-1]\n""")
|
||||
_install_chronos(args=args, stdout=stdout)
|
||||
|
||||
args = ['--app-id=chronos-2']
|
||||
stdout = (b"""Installing package [chronos] version [2.3.3] with app """
|
||||
stdout = (b"""Installing package [chronos] version [2.3.4] with app """
|
||||
b"""id [chronos-2]\n""")
|
||||
_install_chronos(args=args, stdout=stdout)
|
||||
|
||||
@@ -448,7 +448,7 @@ mesos/chronos\\n\\tIssues: https:/github.com/mesos/chronos/issues",
|
||||
"mesosphere",
|
||||
"framework"
|
||||
],
|
||||
"version": "2.3.3"
|
||||
"version": "2.3.4"
|
||||
}
|
||||
]
|
||||
"""
|
||||
@@ -611,7 +611,7 @@ def _uninstall_chronos(args=[], returncode=0, stdout=b'', stderr=b''):
|
||||
def _install_chronos(
|
||||
args=[],
|
||||
returncode=0,
|
||||
stdout=b'Installing package [chronos] version [2.3.3]\n',
|
||||
stdout=b'Installing package [chronos] version [2.3.4]\n',
|
||||
stderr=b'',
|
||||
postInstallNotes=b'Chronos DCOS Service has been successfully '
|
||||
b'installed!\nWe recommend a minimum of one node '
|
||||
|
||||
@@ -23,9 +23,17 @@ def get_master(config=None):
|
||||
if config is None:
|
||||
config = util.get_config()
|
||||
|
||||
mesos_master_url = util.get_config_vals(
|
||||
config, ['core.mesos_master_url'])[0]
|
||||
return MesosMaster(mesos_master_url)
|
||||
mesos_url = get_mesos_url(config)
|
||||
return MesosMaster(mesos_url)
|
||||
|
||||
|
||||
def get_mesos_url(config):
|
||||
mesos_master_url = config.get('core.mesos_master_url')
|
||||
if mesos_master_url is None:
|
||||
dcos_url = util.get_config_vals(config, ['core.dcos_url'])[0]
|
||||
return urllib.parse.urljoin(dcos_url, 'mesos/')
|
||||
else:
|
||||
return mesos_master_url
|
||||
|
||||
|
||||
MESOS_TIMEOUT = 3
|
||||
@@ -51,7 +59,7 @@ class MesosMaster(object):
|
||||
"""
|
||||
|
||||
if not self._state:
|
||||
self._state = self.fetch('/master/state.json').json()
|
||||
self._state = self.fetch('master/state.json').json()
|
||||
return self._state
|
||||
|
||||
def slave(self, fltr):
|
||||
|
||||
Reference in New Issue
Block a user