Merge "utils/config: generate param_config.json if param_config exists"
This commit is contained in:
commit
3fdc95b987
@ -70,6 +70,9 @@ class TestConfig(base.TestCase):
|
|||||||
elif config == 'step_config':
|
elif config == 'step_config':
|
||||||
expected_calls += [call('/tmp/tht/%s/%s.pp' %
|
expected_calls += [call('/tmp/tht/%s/%s.pp' %
|
||||||
(role, config))]
|
(role, config))]
|
||||||
|
elif config == 'param_config':
|
||||||
|
expected_calls += [call('/tmp/tht/%s/%s.json' %
|
||||||
|
(role, config))]
|
||||||
else:
|
else:
|
||||||
expected_calls += [call('/tmp/tht/%s/%s.yaml' %
|
expected_calls += [call('/tmp/tht/%s/%s.yaml' %
|
||||||
(role, config))]
|
(role, config))]
|
||||||
@ -608,6 +611,9 @@ class TestConfig(base.TestCase):
|
|||||||
elif config == 'step_config':
|
elif config == 'step_config':
|
||||||
expected_calls += [call('/tmp/tht/%s/%s.pp' %
|
expected_calls += [call('/tmp/tht/%s/%s.pp' %
|
||||||
(role, config))]
|
(role, config))]
|
||||||
|
elif config == 'param_config':
|
||||||
|
expected_calls += [call('/tmp/tht/%s/%s.json' %
|
||||||
|
(role, config))]
|
||||||
else:
|
else:
|
||||||
expected_calls += [call('/tmp/tht/%s/%s.yaml' %
|
expected_calls += [call('/tmp/tht/%s/%s.yaml' %
|
||||||
(role, config))]
|
(role, config))]
|
||||||
|
@ -213,6 +213,10 @@ class Config(object):
|
|||||||
filepath = os.path.join(role_path, 'step_config.pp')
|
filepath = os.path.join(role_path, 'step_config.pp')
|
||||||
with self._open_file(filepath) as step_config:
|
with self._open_file(filepath) as step_config:
|
||||||
step_config.write(role[config])
|
step_config.write(role[config])
|
||||||
|
elif config == 'param_config':
|
||||||
|
filepath = os.path.join(role_path, 'param_config.json')
|
||||||
|
with self._open_file(filepath) as param_config:
|
||||||
|
param_config.write(json.dumps(role[config]))
|
||||||
elif config == 'ansible_group_vars':
|
elif config == 'ansible_group_vars':
|
||||||
# NOTE(aschultz): ansible group vars are for specific role
|
# NOTE(aschultz): ansible group vars are for specific role
|
||||||
# services so we merge them in with the others so they
|
# services so we merge them in with the others so they
|
||||||
|
Loading…
Reference in New Issue
Block a user