cloudstack: rename displaytext, displayname to dislplay_... for consistency

This commit is contained in:
Rene Moser 2015-08-19 21:51:34 +02:00 committed by Matt Clay
parent 65dc7af166
commit 7bcbc7819c
5 changed files with 27 additions and 30 deletions

View file

@ -150,7 +150,7 @@ name:
returned: success returned: success
type: string type: string
sample: Debian 7 64-bit sample: Debian 7 64-bit
displaytext: display_text:
description: Text to be displayed of the ISO. description: Text to be displayed of the ISO.
returned: success returned: success
type: string type: string

View file

@ -31,10 +31,10 @@ options:
description: description:
- Name (case sensitive) of the network. - Name (case sensitive) of the network.
required: true required: true
displaytext: display_text:
description: description:
- Displaytext of the network. - Display text of the network.
- If not specified, C(name) will be used as displaytext. - If not specified, C(name) will be used as C(display_text).
required: false required: false
default: null default: null
network_offering: network_offering:
@ -177,7 +177,7 @@ EXAMPLES = '''
- local_action: - local_action:
module: cs_network module: cs_network
name: my network name: my network
displaytext: network of domain example.local display_text: network of domain example.local
network_domain: example.local network_domain: example.local
# restart a network with clean up # restart a network with clean up
@ -206,7 +206,7 @@ name:
returned: success returned: success
type: string type: string
sample: web project sample: web project
displaytext: display_text:
description: Display text of the network. description: Display text of the network.
returned: success returned: success
type: string type: string
@ -390,7 +390,7 @@ class AnsibleCloudStackNetwork(AnsibleCloudStack):
def _get_args(self): def _get_args(self):
args = {} args = {}
args['name'] = self.module.params.get('name') args['name'] = self.module.params.get('name')
args['displaytext'] = self.get_or_fallback('displaytext', 'name') args['displaytext'] = self.get_or_fallback('display_text', 'name')
args['networkdomain'] = self.module.params.get('network_domain') args['networkdomain'] = self.module.params.get('network_domain')
args['networkofferingid'] = self.get_network_offering(key='id') args['networkofferingid'] = self.get_network_offering(key='id')
return args return args
@ -525,7 +525,7 @@ def main():
module = AnsibleModule( module = AnsibleModule(
argument_spec = dict( argument_spec = dict(
name = dict(required=True), name = dict(required=True),
displaytext = dict(default=None), display_text = dict(default=None),
network_offering = dict(default=None), network_offering = dict(default=None),
zone = dict(default=None), zone = dict(default=None),
start_ip = dict(default=None), start_ip = dict(default=None),

View file

@ -31,10 +31,10 @@ options:
description: description:
- Name of the project. - Name of the project.
required: true required: true
displaytext: display_text:
description: description:
- Displaytext of the project. - Display text of the project.
- If not specified, C(name) will be used as displaytext. - If not specified, C(name) will be used as C(display_text).
required: false required: false
default: null default: null
state: state:
@ -71,7 +71,7 @@ EXAMPLES = '''
- local_action: - local_action:
module: cs_project module: cs_project
name: web name: web
displaytext: my web project display_text: my web project
# Suspend an existing project # Suspend an existing project
- local_action: - local_action:
@ -104,7 +104,7 @@ name:
returned: success returned: success
type: string type: string
sample: web project sample: web project
displaytext: display_text:
description: Display text of the project. description: Display text of the project.
returned: success returned: success
type: string type: string
@ -173,7 +173,7 @@ class AnsibleCloudStackProject(AnsibleCloudStack):
def update_project(self, project): def update_project(self, project):
args = {} args = {}
args['id'] = project['id'] args['id'] = project['id']
args['displaytext'] = self.get_or_fallback('displaytext', 'name') args['displaytext'] = self.get_or_fallback('display_text', 'name')
if self._has_changed(args, project): if self._has_changed(args, project):
self.result['changed'] = True self.result['changed'] = True
@ -194,7 +194,7 @@ class AnsibleCloudStackProject(AnsibleCloudStack):
args = {} args = {}
args['name'] = self.module.params.get('name') args['name'] = self.module.params.get('name')
args['displaytext'] = self.get_or_fallback('displaytext', 'name') args['displaytext'] = self.get_or_fallback('display_text', 'name')
args['account'] = self.get_account('name') args['account'] = self.get_account('name')
args['domainid'] = self.get_domain('id') args['domainid'] = self.get_domain('id')
@ -262,7 +262,7 @@ def main():
module = AnsibleModule( module = AnsibleModule(
argument_spec = dict( argument_spec = dict(
name = dict(required=True), name = dict(required=True),
displaytext = dict(default=None), display_text = dict(default=None),
state = dict(choices=['present', 'absent', 'active', 'suspended' ], default='present'), state = dict(choices=['present', 'absent', 'active', 'suspended' ], default='present'),
domain = dict(default=None), domain = dict(default=None),
account = dict(default=None), account = dict(default=None),

View file

@ -158,9 +158,9 @@ options:
- 32 or 64 bits support. - 32 or 64 bits support.
required: false required: false
default: '64' default: '64'
displaytext: display_text:
description: description:
- the display text of the template. - Display text of the template.
required: true required: true
default: null default: null
state: state:
@ -229,8 +229,8 @@ name:
returned: success returned: success
type: string type: string
sample: Debian 7 64-bit sample: Debian 7 64-bit
displaytext: display_text:
description: Displaytext of the template. description: Display text of the template.
returned: success returned: success
type: string type: string
sample: Debian 7.7 64-bit minimal 2015-03-19 sample: Debian 7.7 64-bit minimal 2015-03-19
@ -371,7 +371,7 @@ class AnsibleCloudStackTemplate(AnsibleCloudStack):
def _get_args(self): def _get_args(self):
args = {} args = {}
args['name'] = self.module.params.get('name') args['name'] = self.module.params.get('name')
args['displaytext'] = self.module.params.get('displaytext') args['displaytext'] = self.get_or_fallback('display_text', 'name')
args['bits'] = self.module.params.get('bits') args['bits'] = self.module.params.get('bits')
args['isdynamicallyscalable'] = self.module.params.get('is_dynamically_scalable') args['isdynamicallyscalable'] = self.module.params.get('is_dynamically_scalable')
args['isextractable'] = self.module.params.get('is_extractable') args['isextractable'] = self.module.params.get('is_extractable')
@ -385,8 +385,6 @@ class AnsibleCloudStackTemplate(AnsibleCloudStack):
if not args['ostypeid']: if not args['ostypeid']:
self.module.fail_json(msg="Missing required arguments: os_type") self.module.fail_json(msg="Missing required arguments: os_type")
if not args['displaytext']:
args['displaytext'] = self.module.params.get('name')
return args return args
@ -523,7 +521,7 @@ def main():
module = AnsibleModule( module = AnsibleModule(
argument_spec = dict( argument_spec = dict(
name = dict(required=True), name = dict(required=True),
displaytext = dict(default=None), display_text = dict(default=None),
url = dict(default=None), url = dict(default=None),
vm = dict(default=None), vm = dict(default=None),
snapshot = dict(default=None), snapshot = dict(default=None),

View file

@ -28,9 +28,9 @@ author: "René Moser (@resmo)"
options: options:
name: name:
description: description:
- Unique Name of the snapshot. In CloudStack terms C(displayname). - Unique Name of the snapshot. In CloudStack terms display name.
required: true required: true
aliases: ['displayname'] aliases: ['display_name']
vm: vm:
description: description:
- Name of the virtual machine. - Name of the virtual machine.
@ -114,8 +114,8 @@ name:
returned: success returned: success
type: string type: string
sample: snapshot before update sample: snapshot before update
displayname: display_name:
description: displayname of the snapshot. description: Display name of the snapshot.
returned: success returned: success
type: string type: string
sample: snapshot before update sample: snapshot before update
@ -140,7 +140,6 @@ type:
type: string type: string
sample: DiskAndMemory sample: DiskAndMemory
description: description:
description:
description: description of vm snapshot description: description of vm snapshot
returned: success returned: success
type: string type: string
@ -259,7 +258,7 @@ class AnsibleCloudStackVmSnapshot(AnsibleCloudStack):
def main(): def main():
module = AnsibleModule( module = AnsibleModule(
argument_spec = dict( argument_spec = dict(
name = dict(required=True, aliases=['displayname']), name = dict(required=True, aliases=['display_name']),
vm = dict(required=True), vm = dict(required=True),
description = dict(default=None), description = dict(default=None),
zone = dict(default=None), zone = dict(default=None),