From 594d7d5d9d1ee77c7455ca8b5933ffe6377ca905 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Moser?= Date: Sat, 29 Apr 2017 09:16:21 +0200 Subject: [PATCH] cloudstack: cs_region: fix pep8 (#24134) --- .../modules/cloud/cloudstack/cs_region.py | 17 ++++++++++++----- test/sanity/pep8/legacy-files.txt | 1 - 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/lib/ansible/modules/cloud/cloudstack/cs_region.py b/lib/ansible/modules/cloud/cloudstack/cs_region.py index c417905bc6..f47b221134 100644 --- a/lib/ansible/modules/cloud/cloudstack/cs_region.py +++ b/lib/ansible/modules/cloud/cloudstack/cs_region.py @@ -91,20 +91,26 @@ endpoint: type: string sample: http://cloud.example.com gslb_service_enabled: - description: Whether the GSLB service is enabled or not + description: Whether the GSLB service is enabled or not. returned: success type: bool sample: true portable_ip_service_enabled: - description: Whether the portable IP service is enabled or not + description: Whether the portable IP service is enabled or not. returned: success type: bool sample: true ''' -from ansible.module_utils.cloudstack import * from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils.cloudstack import ( + AnsibleCloudStack, + CloudStackException, + cs_argument_spec, + cs_required_together +) + class AnsibleCloudStackRegion(AnsibleCloudStack): @@ -175,8 +181,8 @@ def main(): argument_spec = cs_argument_spec() argument_spec.update(dict( id=dict(required=True, type='int'), - name=dict(default=None), - endpoint=dict(default=None), + name=dict(), + endpoint=dict(), state=dict(choices=['present', 'absent'], default='present'), )) @@ -205,5 +211,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/test/sanity/pep8/legacy-files.txt b/test/sanity/pep8/legacy-files.txt index 8621913da6..3346fdcc8e 100644 --- a/test/sanity/pep8/legacy-files.txt +++ b/test/sanity/pep8/legacy-files.txt @@ -245,7 +245,6 @@ lib/ansible/modules/cloud/cloudstack/cs_nic.py lib/ansible/modules/cloud/cloudstack/cs_pod.py lib/ansible/modules/cloud/cloudstack/cs_portforward.py lib/ansible/modules/cloud/cloudstack/cs_project.py -lib/ansible/modules/cloud/cloudstack/cs_region.py lib/ansible/modules/cloud/cloudstack/cs_router.py lib/ansible/modules/cloud/cloudstack/cs_securitygroup.py lib/ansible/modules/cloud/cloudstack/cs_securitygroup_rule.py