From 597e98fec079c839831036495950f5cba2778d1d Mon Sep 17 00:00:00 2001 From: ricolin Date: Sat, 23 Sep 2017 02:13:40 +0800 Subject: Load files from adopt file when adopt stack Add files from adopt file into create fields. This allow us to adopt nested stack which the template defined in files. Story: #1700744 Task: #17263 Change-Id: I2b473791186949d49be59ee790185b3e394c7000 --- heatclient/v1/shell.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'heatclient/v1') diff --git a/heatclient/v1/shell.py b/heatclient/v1/shell.py index e5bf19c..66d9651 100644 --- a/heatclient/v1/shell.py +++ b/heatclient/v1/shell.py @@ -185,6 +185,10 @@ def do_stack_adopt(hc, args): adopt_url = utils.normalise_file_path_to_url(args.adopt_file) adopt_data = request.urlopen(adopt_url).read() + yaml_adopt_data = yaml.safe_load(adopt_data) or {} + + files = yaml_adopt_data.get('files', {}) + files.update(env_files) if not len(adopt_data): raise exc.CommandError('Invalid adopt-file, no data!') @@ -201,7 +205,7 @@ def do_stack_adopt(hc, args): 'disable_rollback': not(args.enable_rollback), 'adopt_stack_data': adopt_data, 'parameters': utils.format_parameters(args.parameters), - 'files': dict(list(env_files.items())), + 'files': files, 'environment': env } -- cgit v1.2.1