Adding ability to set 'properties' via Glance

The 'Glance' plugin lacked the ability to set properties
on the images that were created via the plugin.  This patch
adds that ability.

Change-Id: If2c73050ed8335b3a22b79bb7ce28189de046427
This commit is contained in:
Chris Hultin 2016-06-10 10:39:11 -05:00 committed by Christopher Hultin
parent a72d40ef8a
commit 7d534a4e8d
1 changed files with 7 additions and 1 deletions

View File

@ -57,6 +57,9 @@ options:
choices:
- true (public)
- false (private)
image_properties:
description:
- List of properties and their values
api_version:
description:
- which version of the glance api to use
@ -85,6 +88,7 @@ EXAMPLES = """
image_container_format: bare
image_disk_format: qcow2
image_is_public: True
image_properties: { "os_distro": "cirros" }
# Get facts about existing images
- name: Get image facts
@ -183,7 +187,8 @@ class ManageGlance(object):
name=image_name,
disk_format=p['image_disk_format'],
container_format=p['image_container_format'],
copy_from=p['image_url']
copy_from=p['image_url'],
properties=p['image_properties']
)
if v == '1':
image_opts['is_public'] = p['image_is_public']
@ -223,6 +228,7 @@ def main():
image_container_format=dict(required=False),
image_disk_format=dict(required=False),
image_is_public=dict(required=False, type='bool'),
image_properties=dict(required=False),
api_version=dict(default='1', required=False, choices=['1', '2']),
insecure=dict(default=False, required=False, type='bool')
),