Fixing "commands list" command
TrivialFix Change-Id: I6f73c0c8d6f8d6b69ee311659ae8abb4c242e39a
This commit is contained in:
parent
731d16620a
commit
9b10fa917e
|
@ -29,14 +29,17 @@ CONF.import_group('kolla', 'kolla_mesos.config.kolla')
|
|||
|
||||
|
||||
def _get_task_from_cmd(role, cmd, cmd_info):
|
||||
reg = '/kolla/%s/status/%s/%s' % (CONF.kolla.deployment_id, role, cmd)
|
||||
reg = '/kolla/%s/status/global/%s/%s' % (CONF.kolla.deployment_id,
|
||||
role, cmd)
|
||||
task = {'register': reg, 'requires': []}
|
||||
for dep in cmd_info.get('dependencies', []):
|
||||
dependencies = cmd_info.get('dependencies', None) or []
|
||||
for dep in dependencies:
|
||||
path = dep['path']
|
||||
scope = dep.get('scope', 'global')
|
||||
if scope == 'global':
|
||||
task['requires'].append(
|
||||
'/kolla/%s/status/%s' % (CONF.kolla.deployment_id, path))
|
||||
'/kolla/%s/status/global/%s' % (CONF.kolla.deployment_id,
|
||||
path))
|
||||
elif scope == 'local':
|
||||
task['requires'].append(
|
||||
'/kolla/%s/status/%s/%s' % (CONF.kolla.deployment_id,
|
||||
|
|
|
@ -38,7 +38,7 @@ class CommandsTest(base.BaseTestCase):
|
|||
|
||||
@fake_mesos.FakeMesosStateTaggedSlaves()
|
||||
def test_get_tasks_sanity(self):
|
||||
var = '/kolla/test/status'
|
||||
var = '/kolla/test/status/global'
|
||||
exp = {'register': '%s/cinder-api/db_sync' % var,
|
||||
'requires': [
|
||||
'%s/cinder_ansible_tasks/create_database' % var,
|
||||
|
@ -51,7 +51,7 @@ class CommandsTest(base.BaseTestCase):
|
|||
|
||||
@fake_mesos.FakeMesosStateTaggedSlaves()
|
||||
def test_get_service_tasks_sanity(self):
|
||||
var = '/kolla/test/status'
|
||||
var = '/kolla/test/status/global'
|
||||
exp = {'register': '%s/cinder-api/db_sync' % var,
|
||||
'requires': [
|
||||
'%s/cinder_ansible_tasks/create_database' % var,
|
||||
|
@ -73,7 +73,7 @@ class CommandsTest(base.BaseTestCase):
|
|||
# just get what we want for the test
|
||||
test_tasks = {'cinder-api/db_sync':
|
||||
tasks['cinder-api/db_sync']}
|
||||
var = '/kolla/test/status'
|
||||
var = '/kolla/test/status/global'
|
||||
exp = {
|
||||
'register': ('%s/cinder-api/db_sync' % var, 'waiting'),
|
||||
'requirements': {
|
||||
|
@ -102,7 +102,7 @@ class CommandsTest(base.BaseTestCase):
|
|||
# just get what we want for the test
|
||||
test_tasks = {'cinder-api/db_sync':
|
||||
tasks['cinder-api/db_sync']}
|
||||
var = '/kolla/test/status'
|
||||
var = '/kolla/test/status/global'
|
||||
at = '%s/cinder_ansible_tasks' % var
|
||||
exp = {
|
||||
'register': ('%s/cinder-api/db_sync' % var, ''),
|
||||
|
@ -131,7 +131,7 @@ class CommandsTest(base.BaseTestCase):
|
|||
# just get what we want for the test
|
||||
test_tasks = {'cinder-api/db_sync':
|
||||
tasks['cinder-api/db_sync']}
|
||||
var = '/kolla/test/status'
|
||||
var = '/kolla/test/status/global'
|
||||
at = '%s/cinder_ansible_tasks' % var
|
||||
exp = {
|
||||
'register': ('%s/cinder-api/db_sync' % var, 'done'),
|
||||
|
|
Loading…
Reference in New Issue