From bc6b96d42edcd1a03de2496275dbe1aaad488814 Mon Sep 17 00:00:00 2001 From: Pilou Date: Wed, 7 Mar 2018 15:22:06 +0100 Subject: [PATCH] webfaction modules: fix broken import (#35024) * webfaction_app: fix broken import * doc: use formatting functions * webaction_db: fix broken import * webfaction_domain: fix broken import * webfaction_mailbox: fix broken import * webaction_site: fix broken import * webfaction modules: fix doc --- .../modules/cloud/webfaction/webfaction_app.py | 15 +++++++-------- .../modules/cloud/webfaction/webfaction_db.py | 9 ++++----- .../modules/cloud/webfaction/webfaction_domain.py | 7 +++---- .../cloud/webfaction/webfaction_mailbox.py | 4 ++-- .../modules/cloud/webfaction/webfaction_site.py | 7 ++++--- test/sanity/import/skip.txt | 4 ---- test/sanity/validate-modules/ignore.txt | 5 ----- 7 files changed, 20 insertions(+), 31 deletions(-) diff --git a/lib/ansible/modules/cloud/webfaction/webfaction_app.py b/lib/ansible/modules/cloud/webfaction/webfaction_app.py index ebe7bfad78d..3970db30ce6 100644 --- a/lib/ansible/modules/cloud/webfaction/webfaction_app.py +++ b/lib/ansible/modules/cloud/webfaction/webfaction_app.py @@ -25,7 +25,7 @@ DOCUMENTATION = ''' module: webfaction_app short_description: Add or remove applications on a Webfaction host description: - - Add or remove applications on a Webfaction host. Further documentation at http://github.com/quentinsf/ansible-webfaction. + - Add or remove applications on a Webfaction host. Further documentation at U(http://github.com/quentinsf/ansible-webfaction). author: Quentin Stafford-Fraser (@quentinsf) version_added: "2.0" notes: @@ -50,12 +50,12 @@ options: type: description: - - The type of application to create. See the Webfaction docs at http://docs.webfaction.com/xmlrpc-api/apps.html for a list. + - The type of application to create. See the Webfaction docs at U(http://docs.webfaction.com/xmlrpc-api/apps.html) for a list. required: true autostart: description: - - Whether the app should restart with an autostart.cgi script + - Whether the app should restart with an C(autostart.cgi) script type: bool default: "no" @@ -63,7 +63,7 @@ options: description: - Any extra parameters required by the app required: false - default: null + default: '' port_open: description: @@ -84,7 +84,7 @@ options: machine: description: - The machine name to use (optional for accounts with only one machine) - required: false + default: false ''' @@ -99,12 +99,11 @@ EXAMPLES = ''' machine: "{{webfaction_machine}}" ''' -import xmlrpclib - from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils.six.moves import xmlrpc_client -webfaction = xmlrpclib.ServerProxy('https://api.webfaction.com/') +webfaction = xmlrpc_client.ServerProxy('https://api.webfaction.com/') def main(): diff --git a/lib/ansible/modules/cloud/webfaction/webfaction_db.py b/lib/ansible/modules/cloud/webfaction/webfaction_db.py index 28d16a3f8ea..dcccb358987 100644 --- a/lib/ansible/modules/cloud/webfaction/webfaction_db.py +++ b/lib/ansible/modules/cloud/webfaction/webfaction_db.py @@ -55,7 +55,7 @@ options: description: - The password for the new database user. required: false - default: None + default: null login_name: description: @@ -70,7 +70,7 @@ options: machine: description: - The machine name to use (optional for accounts with only one machine) - required: false + default: false ''' EXAMPLES = ''' @@ -91,12 +91,11 @@ EXAMPLES = ''' ''' -import xmlrpclib - from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils.six.moves import xmlrpc_client -webfaction = xmlrpclib.ServerProxy('https://api.webfaction.com/') +webfaction = xmlrpc_client.ServerProxy('https://api.webfaction.com/') def main(): diff --git a/lib/ansible/modules/cloud/webfaction/webfaction_domain.py b/lib/ansible/modules/cloud/webfaction/webfaction_domain.py index 2b32de866e2..e3e94d19027 100644 --- a/lib/ansible/modules/cloud/webfaction/webfaction_domain.py +++ b/lib/ansible/modules/cloud/webfaction/webfaction_domain.py @@ -49,7 +49,7 @@ options: description: - Any subdomains to create. required: false - default: null + default: [] login_name: description: @@ -82,12 +82,11 @@ EXAMPLES = ''' ''' -import xmlrpclib - from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils.six.moves import xmlrpc_client -webfaction = xmlrpclib.ServerProxy('https://api.webfaction.com/') +webfaction = xmlrpc_client.ServerProxy('https://api.webfaction.com/') def main(): diff --git a/lib/ansible/modules/cloud/webfaction/webfaction_mailbox.py b/lib/ansible/modules/cloud/webfaction/webfaction_mailbox.py index a39afe75ff6..4e8db64b9ab 100644 --- a/lib/ansible/modules/cloud/webfaction/webfaction_mailbox.py +++ b/lib/ansible/modules/cloud/webfaction/webfaction_mailbox.py @@ -69,12 +69,12 @@ EXAMPLES = ''' login_password={{webfaction_passwd}} ''' -import xmlrpclib from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils.six.moves import xmlrpc_client -webfaction = xmlrpclib.ServerProxy('https://api.webfaction.com/') +webfaction = xmlrpc_client.ServerProxy('https://api.webfaction.com/') def main(): diff --git a/lib/ansible/modules/cloud/webfaction/webfaction_site.py b/lib/ansible/modules/cloud/webfaction/webfaction_site.py index 4230b659ade..54e18bbfd1b 100644 --- a/lib/ansible/modules/cloud/webfaction/webfaction_site.py +++ b/lib/ansible/modules/cloud/webfaction/webfaction_site.py @@ -60,12 +60,13 @@ options: description: - A mapping of URLs to apps required: false + default: [] subdomains: description: - A list of subdomains associated with this site. required: false - default: null + default: [] login_name: description: @@ -94,12 +95,12 @@ EXAMPLES = ''' ''' import socket -import xmlrpclib from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils.six.moves import xmlrpc_client -webfaction = xmlrpclib.ServerProxy('https://api.webfaction.com/') +webfaction = xmlrpc_client.ServerProxy('https://api.webfaction.com/') def main(): diff --git a/test/sanity/import/skip.txt b/test/sanity/import/skip.txt index 6b077b5b004..8a54937ee6b 100644 --- a/test/sanity/import/skip.txt +++ b/test/sanity/import/skip.txt @@ -1,8 +1,4 @@ lib/ansible/modules/cloud/azure/azure_rm_storageaccount.py -lib/ansible/modules/cloud/webfaction/webfaction_app.py -lib/ansible/modules/cloud/webfaction/webfaction_db.py -lib/ansible/modules/cloud/webfaction/webfaction_domain.py -lib/ansible/modules/cloud/webfaction/webfaction_mailbox.py lib/ansible/modules/cloud/webfaction/webfaction_site.py lib/ansible/modules/clustering/k8s/k8s_raw.py lib/ansible/modules/clustering/k8s/k8s_scale.py diff --git a/test/sanity/validate-modules/ignore.txt b/test/sanity/validate-modules/ignore.txt index ebb9e9d9b7d..441c9d1fdd8 100644 --- a/test/sanity/validate-modules/ignore.txt +++ b/test/sanity/validate-modules/ignore.txt @@ -867,11 +867,6 @@ lib/ansible/modules/cloud/vultr/vr_user.py E322 lib/ansible/modules/cloud/vultr/vr_user.py E324 lib/ansible/modules/cloud/vultr/vr_user.py E325 lib/ansible/modules/cloud/vultr/vr_user.py E326 -lib/ansible/modules/cloud/webfaction/webfaction_app.py E321 -lib/ansible/modules/cloud/webfaction/webfaction_db.py E321 -lib/ansible/modules/cloud/webfaction/webfaction_domain.py E321 -lib/ansible/modules/cloud/webfaction/webfaction_mailbox.py E321 -lib/ansible/modules/cloud/webfaction/webfaction_site.py E321 lib/ansible/modules/clustering/consul.py E322 lib/ansible/modules/clustering/consul.py E324 lib/ansible/modules/clustering/consul.py E325