diff options
author | ricolin <rico.lin@easystack.cn> | 2017-09-23 02:13:40 +0800 |
---|---|---|
committer | Rico Lin <rico.lin@easystack.cn> | 2018-07-20 15:34:04 +0000 |
commit | 597e98fec079c839831036495950f5cba2778d1d (patch) | |
tree | 990a9ff87bdf0d61090b6dd833bef99a80389a82 /heatclient/v1/shell.py | |
parent | 92a4f251f98a2fcc32cbecf5d70095a1e3834f5f (diff) | |
download | python-heatclient-597e98fec079c839831036495950f5cba2778d1d.tar.gz |
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
Diffstat (limited to 'heatclient/v1/shell.py')
-rw-r--r-- | heatclient/v1/shell.py | 6 |
1 files changed, 5 insertions, 1 deletions
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 } |