From 7bcbc7819cb3f46bd5b4e8bca8e333611613bcdd Mon Sep 17 00:00:00 2001 From: Rene Moser Date: Wed, 19 Aug 2015 21:51:34 +0200 Subject: [PATCH] cloudstack: rename displaytext, displayname to dislplay_... for consistency --- .../modules/extras/cloud/cloudstack/cs_iso.py | 2 +- .../extras/cloud/cloudstack/cs_network.py | 14 +++++++------- .../extras/cloud/cloudstack/cs_project.py | 16 ++++++++-------- .../extras/cloud/cloudstack/cs_template.py | 14 ++++++-------- .../extras/cloud/cloudstack/cs_vmsnapshot.py | 11 +++++------ 5 files changed, 27 insertions(+), 30 deletions(-) diff --git a/lib/ansible/modules/extras/cloud/cloudstack/cs_iso.py b/lib/ansible/modules/extras/cloud/cloudstack/cs_iso.py index 62986502a6..37f110cbe6 100644 --- a/lib/ansible/modules/extras/cloud/cloudstack/cs_iso.py +++ b/lib/ansible/modules/extras/cloud/cloudstack/cs_iso.py @@ -150,7 +150,7 @@ name: returned: success type: string sample: Debian 7 64-bit -displaytext: +display_text: description: Text to be displayed of the ISO. returned: success type: string diff --git a/lib/ansible/modules/extras/cloud/cloudstack/cs_network.py b/lib/ansible/modules/extras/cloud/cloudstack/cs_network.py index 538f62896a..6076c1a131 100644 --- a/lib/ansible/modules/extras/cloud/cloudstack/cs_network.py +++ b/lib/ansible/modules/extras/cloud/cloudstack/cs_network.py @@ -31,10 +31,10 @@ options: description: - Name (case sensitive) of the network. required: true - displaytext: + display_text: description: - - Displaytext of the network. - - If not specified, C(name) will be used as displaytext. + - Display text of the network. + - If not specified, C(name) will be used as C(display_text). required: false default: null network_offering: @@ -177,7 +177,7 @@ EXAMPLES = ''' - local_action: module: cs_network name: my network - displaytext: network of domain example.local + display_text: network of domain example.local network_domain: example.local # restart a network with clean up @@ -206,7 +206,7 @@ name: returned: success type: string sample: web project -displaytext: +display_text: description: Display text of the network. returned: success type: string @@ -390,7 +390,7 @@ class AnsibleCloudStackNetwork(AnsibleCloudStack): def _get_args(self): args = {} 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['networkofferingid'] = self.get_network_offering(key='id') return args @@ -525,7 +525,7 @@ def main(): module = AnsibleModule( argument_spec = dict( name = dict(required=True), - displaytext = dict(default=None), + display_text = dict(default=None), network_offering = dict(default=None), zone = dict(default=None), start_ip = dict(default=None), diff --git a/lib/ansible/modules/extras/cloud/cloudstack/cs_project.py b/lib/ansible/modules/extras/cloud/cloudstack/cs_project.py index 0bd886ad7e..6a48956bb1 100644 --- a/lib/ansible/modules/extras/cloud/cloudstack/cs_project.py +++ b/lib/ansible/modules/extras/cloud/cloudstack/cs_project.py @@ -31,10 +31,10 @@ options: description: - Name of the project. required: true - displaytext: + display_text: description: - - Displaytext of the project. - - If not specified, C(name) will be used as displaytext. + - Display text of the project. + - If not specified, C(name) will be used as C(display_text). required: false default: null state: @@ -71,7 +71,7 @@ EXAMPLES = ''' - local_action: module: cs_project name: web - displaytext: my web project + display_text: my web project # Suspend an existing project - local_action: @@ -104,7 +104,7 @@ name: returned: success type: string sample: web project -displaytext: +display_text: description: Display text of the project. returned: success type: string @@ -173,7 +173,7 @@ class AnsibleCloudStackProject(AnsibleCloudStack): def update_project(self, project): args = {} 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): self.result['changed'] = True @@ -194,7 +194,7 @@ class AnsibleCloudStackProject(AnsibleCloudStack): args = {} 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['domainid'] = self.get_domain('id') @@ -262,7 +262,7 @@ def main(): module = AnsibleModule( argument_spec = dict( name = dict(required=True), - displaytext = dict(default=None), + display_text = dict(default=None), state = dict(choices=['present', 'absent', 'active', 'suspended' ], default='present'), domain = dict(default=None), account = dict(default=None), diff --git a/lib/ansible/modules/extras/cloud/cloudstack/cs_template.py b/lib/ansible/modules/extras/cloud/cloudstack/cs_template.py index e53ec8825b..8e5b8c2490 100644 --- a/lib/ansible/modules/extras/cloud/cloudstack/cs_template.py +++ b/lib/ansible/modules/extras/cloud/cloudstack/cs_template.py @@ -158,9 +158,9 @@ options: - 32 or 64 bits support. required: false default: '64' - displaytext: + display_text: description: - - the display text of the template. + - Display text of the template. required: true default: null state: @@ -229,8 +229,8 @@ name: returned: success type: string sample: Debian 7 64-bit -displaytext: - description: Displaytext of the template. +display_text: + description: Display text of the template. returned: success type: string sample: Debian 7.7 64-bit minimal 2015-03-19 @@ -371,7 +371,7 @@ class AnsibleCloudStackTemplate(AnsibleCloudStack): def _get_args(self): args = {} 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['isdynamicallyscalable'] = self.module.params.get('is_dynamically_scalable') args['isextractable'] = self.module.params.get('is_extractable') @@ -385,8 +385,6 @@ class AnsibleCloudStackTemplate(AnsibleCloudStack): if not args['ostypeid']: self.module.fail_json(msg="Missing required arguments: os_type") - if not args['displaytext']: - args['displaytext'] = self.module.params.get('name') return args @@ -523,7 +521,7 @@ def main(): module = AnsibleModule( argument_spec = dict( name = dict(required=True), - displaytext = dict(default=None), + display_text = dict(default=None), url = dict(default=None), vm = dict(default=None), snapshot = dict(default=None), diff --git a/lib/ansible/modules/extras/cloud/cloudstack/cs_vmsnapshot.py b/lib/ansible/modules/extras/cloud/cloudstack/cs_vmsnapshot.py index c7faf8b746..a8f2fbaa91 100644 --- a/lib/ansible/modules/extras/cloud/cloudstack/cs_vmsnapshot.py +++ b/lib/ansible/modules/extras/cloud/cloudstack/cs_vmsnapshot.py @@ -28,9 +28,9 @@ author: "René Moser (@resmo)" options: name: description: - - Unique Name of the snapshot. In CloudStack terms C(displayname). + - Unique Name of the snapshot. In CloudStack terms display name. required: true - aliases: ['displayname'] + aliases: ['display_name'] vm: description: - Name of the virtual machine. @@ -114,8 +114,8 @@ name: returned: success type: string sample: snapshot before update -displayname: - description: displayname of the snapshot. +display_name: + description: Display name of the snapshot. returned: success type: string sample: snapshot before update @@ -140,7 +140,6 @@ type: type: string sample: DiskAndMemory description: - description: description: description of vm snapshot returned: success type: string @@ -259,7 +258,7 @@ class AnsibleCloudStackVmSnapshot(AnsibleCloudStack): def main(): module = AnsibleModule( argument_spec = dict( - name = dict(required=True, aliases=['displayname']), + name = dict(required=True, aliases=['display_name']), vm = dict(required=True), description = dict(default=None), zone = dict(default=None),