mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-22 09:50:37 +00:00
EC2 provider: fixing snapshot tagging
This commit is contained in:
parent
d92123c9dd
commit
673260ec63
1 changed files with 7 additions and 6 deletions
|
@ -29,9 +29,10 @@ class Snapshot(Task):
|
|||
def run(cls, info):
|
||||
info._ec2['snapshot'] = info.volume.snapshot()
|
||||
|
||||
# # Setting up tags on the snapshot
|
||||
# if 'tags' in info.manifest.data:
|
||||
# raw_tags = info.manifest.data['tags']
|
||||
# tags = {k: v.format(**info.manifest_vars) for k, v in raw_tags.items()}
|
||||
# info._ec2['connection'](Resources=[info._ec2['snapshot']],
|
||||
# Tags=[tags])
|
||||
# Setting up tags on the snapshot
|
||||
if 'tags' in info.manifest.data:
|
||||
raw_tags = info.manifest.data['tags']
|
||||
formatted_tags = {k: v.format(**info.manifest_vars) for k, v in raw_tags.items()}
|
||||
tags = [{'Key': k, 'Value': v} for k, v in formatted_tags.items()]
|
||||
info._ec2['connection'].create_tags(Resources=[info._ec2['snapshot']],
|
||||
Tags=tags)
|
||||
|
|
Loading…
Add table
Reference in a new issue