mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-27 04:41:26 -07:00
cs_template: fix KeyError on state=extracted (#48675)
* cs_template: fix KeyError on state=extracted * add changelog
This commit is contained in:
parent
5126068a19
commit
c7c3ca1c41
2 changed files with 30 additions and 25 deletions
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- cs_template - Fixed a KeyError on state=extracted.
|
|
@ -243,78 +243,78 @@ EXAMPLES = '''
|
||||||
RETURN = '''
|
RETURN = '''
|
||||||
---
|
---
|
||||||
id:
|
id:
|
||||||
description: UUID of the template.
|
description: UUID of the template or extracted object.
|
||||||
returned: success
|
returned: success
|
||||||
type: string
|
type: string
|
||||||
sample: a6f7a5fc-43f8-11e5-a151-feff819cdc9f
|
sample: a6f7a5fc-43f8-11e5-a151-feff819cdc9f
|
||||||
name:
|
name:
|
||||||
description: Name of the template.
|
description: Name of the template or extracted object.
|
||||||
returned: success
|
returned: success
|
||||||
type: string
|
type: string
|
||||||
sample: Debian 7 64-bit
|
sample: Debian 7 64-bit
|
||||||
display_text:
|
display_text:
|
||||||
description: Display text of the template.
|
description: Display text of the template.
|
||||||
returned: success
|
returned: if available
|
||||||
type: string
|
type: string
|
||||||
sample: Debian 7.7 64-bit minimal 2015-03-19
|
sample: Debian 7.7 64-bit minimal 2015-03-19
|
||||||
checksum:
|
checksum:
|
||||||
description: MD5 checksum of the template.
|
description: MD5 checksum of the template.
|
||||||
returned: success
|
returned: if available
|
||||||
type: string
|
type: string
|
||||||
sample: 0b31bccccb048d20b551f70830bb7ad0
|
sample: 0b31bccccb048d20b551f70830bb7ad0
|
||||||
status:
|
status:
|
||||||
description: Status of the template.
|
description: Status of the template or extracted object.
|
||||||
returned: success
|
returned: success
|
||||||
type: string
|
type: string
|
||||||
sample: Download Complete
|
sample: Download Complete
|
||||||
is_ready:
|
is_ready:
|
||||||
description: True if the template is ready to be deployed from.
|
description: True if the template is ready to be deployed from.
|
||||||
returned: success
|
returned: if available
|
||||||
type: boolean
|
type: boolean
|
||||||
sample: true
|
sample: true
|
||||||
is_public:
|
is_public:
|
||||||
description: True if the template is public.
|
description: True if the template is public.
|
||||||
returned: success
|
returned: if available
|
||||||
type: boolean
|
type: boolean
|
||||||
sample: true
|
sample: true
|
||||||
is_featured:
|
is_featured:
|
||||||
description: True if the template is featured.
|
description: True if the template is featured.
|
||||||
returned: success
|
returned: if available
|
||||||
type: boolean
|
type: boolean
|
||||||
sample: true
|
sample: true
|
||||||
is_extractable:
|
is_extractable:
|
||||||
description: True if the template is extractable.
|
description: True if the template is extractable.
|
||||||
returned: success
|
returned: if available
|
||||||
type: boolean
|
type: boolean
|
||||||
sample: true
|
sample: true
|
||||||
format:
|
format:
|
||||||
description: Format of the template.
|
description: Format of the template.
|
||||||
returned: success
|
returned: if available
|
||||||
type: string
|
type: string
|
||||||
sample: OVA
|
sample: OVA
|
||||||
os_type:
|
os_type:
|
||||||
description: Typo of the OS.
|
description: Type of the OS.
|
||||||
returned: success
|
returned: if available
|
||||||
type: string
|
type: string
|
||||||
sample: CentOS 6.5 (64-bit)
|
sample: CentOS 6.5 (64-bit)
|
||||||
password_enabled:
|
password_enabled:
|
||||||
description: True if the reset password feature is enabled, false otherwise.
|
description: True if the reset password feature is enabled, false otherwise.
|
||||||
returned: success
|
returned: if available
|
||||||
type: boolean
|
type: boolean
|
||||||
sample: false
|
sample: false
|
||||||
sshkey_enabled:
|
sshkey_enabled:
|
||||||
description: true if template is sshkey enabled, false otherwise.
|
description: true if template is sshkey enabled, false otherwise.
|
||||||
returned: success
|
returned: if available
|
||||||
type: boolean
|
type: boolean
|
||||||
sample: false
|
sample: false
|
||||||
cross_zones:
|
cross_zones:
|
||||||
description: true if the template is managed across all zones, false otherwise.
|
description: true if the template is managed across all zones, false otherwise.
|
||||||
returned: success
|
returned: if available
|
||||||
type: boolean
|
type: boolean
|
||||||
sample: false
|
sample: false
|
||||||
template_type:
|
template_type:
|
||||||
description: Type of the template.
|
description: Type of the template.
|
||||||
returned: success
|
returned: if available
|
||||||
type: string
|
type: string
|
||||||
sample: USER
|
sample: USER
|
||||||
created:
|
created:
|
||||||
|
@ -324,32 +324,32 @@ created:
|
||||||
sample: 2015-03-29T14:57:06+0200
|
sample: 2015-03-29T14:57:06+0200
|
||||||
template_tag:
|
template_tag:
|
||||||
description: Template tag related to this template.
|
description: Template tag related to this template.
|
||||||
returned: success
|
returned: if available
|
||||||
type: string
|
type: string
|
||||||
sample: special
|
sample: special
|
||||||
hypervisor:
|
hypervisor:
|
||||||
description: Hypervisor related to this template.
|
description: Hypervisor related to this template.
|
||||||
returned: success
|
returned: if available
|
||||||
type: string
|
type: string
|
||||||
sample: VMware
|
sample: VMware
|
||||||
mode:
|
mode:
|
||||||
description: Mode of extraction
|
description: Mode of extraction
|
||||||
returned: success
|
returned: on state=extracted
|
||||||
type: string
|
type: string
|
||||||
sample: http_download
|
sample: http_download
|
||||||
state:
|
state:
|
||||||
description: State of the extracted template
|
description: State of the extracted template
|
||||||
returned: success
|
returned: on state=extracted
|
||||||
type: string
|
type: string
|
||||||
sample: DOWNLOAD_URL_CREATED
|
sample: DOWNLOAD_URL_CREATED
|
||||||
url:
|
url:
|
||||||
description: Url to which the template is extracted to
|
description: Url to which the template is extracted to
|
||||||
returned: success
|
returned: on state=extracted
|
||||||
type: string
|
type: string
|
||||||
sample: "http://1.2.3.4/userdata/eb307f13-4aca-45e8-b157-a414a14e6b04.ova"
|
sample: "http://1.2.3.4/userdata/eb307f13-4aca-45e8-b157-a414a14e6b04.ova"
|
||||||
tags:
|
tags:
|
||||||
description: List of resource tags associated with the template.
|
description: List of resource tags associated with the template.
|
||||||
returned: success
|
returned: if available
|
||||||
type: dict
|
type: dict
|
||||||
sample: '[ { "key": "foo", "value": "bar" } ]'
|
sample: '[ { "key": "foo", "value": "bar" } ]'
|
||||||
zone:
|
zone:
|
||||||
|
@ -664,9 +664,12 @@ class AnsibleCloudStackTemplate(AnsibleCloudStack):
|
||||||
def get_result(self, template):
|
def get_result(self, template):
|
||||||
super(AnsibleCloudStackTemplate, self).get_result(template)
|
super(AnsibleCloudStackTemplate, self).get_result(template)
|
||||||
if template:
|
if template:
|
||||||
self.result['is_extractable'] = True if template['isextractable'] else False
|
if 'isextractable' in template:
|
||||||
self.result['is_featured'] = True if template['isfeatured'] else False
|
self.result['is_extractable'] = True if template['isextractable'] else False
|
||||||
self.result['is_public'] = True if template['ispublic'] else False
|
if 'isfeatured' in template:
|
||||||
|
self.result['is_featured'] = True if template['isfeatured'] else False
|
||||||
|
if 'ispublic' in template:
|
||||||
|
self.result['is_public'] = True if template['ispublic'] else False
|
||||||
return self.result
|
return self.result
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue