From 0ce8d389a4048ca89941536aeffd468c0e369bdd Mon Sep 17 00:00:00 2001 From: Pilou Date: Thu, 25 Jan 2018 18:39:49 +0100 Subject: [PATCH] azure_rm_dnsrecordset: fix broken import and minor updates (#34983) * fix broken import Error was: lib/ansible/modules/cloud/azure/azure_rm_dnsrecordset.py:223:0: NameError: name 'ARecord' is not defined * doc: use formatting functions * remove unused dict --- .../modules/cloud/azure/azure_rm_dnsrecordset.py | 11 ++++------- test/sanity/import/skip.txt | 1 - 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/ansible/modules/cloud/azure/azure_rm_dnsrecordset.py b/lib/ansible/modules/cloud/azure/azure_rm_dnsrecordset.py index d8bd27b5dd..3f14970f39 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_dnsrecordset.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_dnsrecordset.py @@ -58,8 +58,8 @@ options: - purge state: description: - - Assert the state of the record set. Use 'present' to create or update and - 'absent' to delete. + - Assert the state of the record set. Use C(present) to create or update and + C(absent) to delete. default: present choices: - absent @@ -174,7 +174,7 @@ import sys from ansible.module_utils.basic import _load_params from ansible.module_utils.six import iteritems -from ansible.module_utils.azure_rm_common import AzureRMModuleBase +from ansible.module_utils.azure_rm_common import AzureRMModuleBase, HAS_AZURE try: from msrestazure.azure_exceptions import CloudError @@ -183,9 +183,6 @@ except ImportError: # This is handled in azure_rm_common pass -base_record = dict( - entry=dict(type='str', required=True) -) RECORD_ARGSPECS = dict( A=dict( @@ -229,7 +226,7 @@ RECORDSET_VALUE_MAP = dict( SRV=dict(attrname='srv_records', classobj=SrvRecord, is_list=True), TXT=dict(attrname='txt_records', classobj=TxtRecord, is_list=True), # FUTURE: add missing record types from https://github.com/Azure/azure-sdk-for-python/blob/master/azure-mgmt-dns/azure/mgmt/dns/models/record_set.py -) +) if HAS_AZURE else {} class AzureRMRecordSet(AzureRMModuleBase): diff --git a/test/sanity/import/skip.txt b/test/sanity/import/skip.txt index 5b701d002a..ec5991261e 100644 --- a/test/sanity/import/skip.txt +++ b/test/sanity/import/skip.txt @@ -1,4 +1,3 @@ -lib/ansible/modules/cloud/azure/azure_rm_dnsrecordset.py lib/ansible/modules/cloud/dimensiondata/dimensiondata_network.py lib/ansible/modules/cloud/webfaction/webfaction_app.py lib/ansible/modules/cloud/webfaction/webfaction_db.py