Merge pull request #402 from ndonegan/devel

sys.exit used, but not imported.
reviewable/pr18780/r1
Brian Coca 11 years ago
commit 2f4fa76298

@ -32,7 +32,7 @@ options:
description: description:
- Account API token. See I(account_email) for info. - Account API token. See I(account_email) for info.
required: false required: false
default: null default: null
domain: domain:
description: description:
@ -67,7 +67,7 @@ options:
default: 3600 (one hour) default: 3600 (one hour)
value: value:
description: description:
- Record value - Record value
- "Must be specified when trying to ensure a record exists" - "Must be specified when trying to ensure a record exists"
required: false required: false
@ -133,9 +133,9 @@ import os
try: try:
from dnsimple import DNSimple from dnsimple import DNSimple
from dnsimple.dnsimple import DNSimpleException from dnsimple.dnsimple import DNSimpleException
HAS_DNSIMPLE = True
except ImportError: except ImportError:
print "failed=True msg='dnsimple required for this module'" HAS_DNSIMPLE = False
sys.exit(1)
def main(): def main():
module = AnsibleModule( module = AnsibleModule(
@ -148,7 +148,7 @@ def main():
type = dict(required=False, choices=['A', 'ALIAS', 'CNAME', 'MX', 'SPF', 'URL', 'TXT', 'NS', 'SRV', 'NAPTR', 'PTR', 'AAAA', 'SSHFP', 'HINFO', 'POOL']), type = dict(required=False, choices=['A', 'ALIAS', 'CNAME', 'MX', 'SPF', 'URL', 'TXT', 'NS', 'SRV', 'NAPTR', 'PTR', 'AAAA', 'SSHFP', 'HINFO', 'POOL']),
ttl = dict(required=False, default=3600, type='int'), ttl = dict(required=False, default=3600, type='int'),
value = dict(required=False), value = dict(required=False),
priority = dict(required=False, type='int'), priority = dict(required=False, type='int'),
state = dict(required=False, choices=['present', 'absent']), state = dict(required=False, choices=['present', 'absent']),
solo = dict(required=False, type='bool'), solo = dict(required=False, type='bool'),
), ),
@ -158,6 +158,9 @@ def main():
supports_check_mode = True, supports_check_mode = True,
) )
if not HAS_DNSIMPLE:
module.fail_json("dnsimple required for this module")
account_email = module.params.get('account_email') account_email = module.params.get('account_email')
account_api_token = module.params.get('account_api_token') account_api_token = module.params.get('account_api_token')
domain = module.params.get('domain') domain = module.params.get('domain')

Loading…
Cancel
Save