diff options
author | Zuul <zuul@review.openstack.org> | 2018-11-20 20:08:28 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2018-11-20 20:08:28 +0000 |
commit | dd5f64c4c49d98f76635ca0dc467d7bbe9f5dbc1 (patch) | |
tree | ba757cd848e1c8882ad933a349d2a72bc929e168 /heatclient/osc | |
parent | ada4b90083ee2d6e61133d759be90daf325358e6 (diff) | |
parent | 597e98fec079c839831036495950f5cba2778d1d (diff) | |
download | python-heatclient-dd5f64c4c49d98f76635ca0dc467d7bbe9f5dbc1.tar.gz |
Merge "Load files from adopt file when adopt stack"
Diffstat (limited to 'heatclient/osc')
-rw-r--r-- | heatclient/osc/v1/stack.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/heatclient/osc/v1/stack.py b/heatclient/osc/v1/stack.py index 3817bea..bdf7f5f 100644 --- a/heatclient/osc/v1/stack.py +++ b/heatclient/osc/v1/stack.py @@ -22,6 +22,7 @@ from osc_lib import utils from oslo_serialization import jsonutils import six from six.moves.urllib import request +import yaml from heatclient._i18n import _ from heatclient.common import event_utils @@ -822,13 +823,15 @@ class AdoptStack(command.ShowOne): adopt_url = heat_utils.normalise_file_path_to_url( parsed_args.adopt_file) adopt_data = request.urlopen(adopt_url).read().decode('utf-8') - + yaml_adopt_data = yaml.safe_load(adopt_data) or {} + files = yaml_adopt_data.get('files', {}) + files.update(env_files) fields = { 'stack_name': parsed_args.name, 'disable_rollback': not parsed_args.enable_rollback, 'adopt_stack_data': adopt_data, 'parameters': heat_utils.format_parameters(parsed_args.parameter), - 'files': dict(list(env_files.items())), + 'files': files, 'environment': env, 'timeout': parsed_args.timeout } |