vultr: fix config ini params ignored (#34848)

* vultr: fix config ini params ignored

* vutlr: align docs with configs
pull/34850/head
René Moser 7 years ago committed by GitHub
parent 7644042d21
commit 5a7a5b88c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -19,8 +19,8 @@ VULTR_API_ENDPOINT = "https://api.vultr.com"
def vultr_argument_spec(): def vultr_argument_spec():
return dict( return dict(
api_key=dict(default=os.environ.get('VULTR_API_KEY'), no_log=True), api_key=dict(default=os.environ.get('VULTR_API_KEY'), no_log=True),
api_timeout=dict(type='int', default=os.environ.get('VULTR_API_TIMEOUT') or 60), api_timeout=dict(type='int', default=os.environ.get('VULTR_API_TIMEOUT')),
api_retries=dict(type='int', default=os.environ.get('VULTR_API_RETRIES') or 5), api_retries=dict(type='int', default=os.environ.get('VULTR_API_RETRIES')),
api_account=dict(default=os.environ.get('VULTR_API_ACCOUNT') or 'default'), api_account=dict(default=os.environ.get('VULTR_API_ACCOUNT') or 'default'),
validate_certs=dict(default=True, type='bool'), validate_certs=dict(default=True, type='bool'),
) )
@ -50,8 +50,8 @@ class Vultr:
self.api_config = { self.api_config = {
'api_key': self.module.params.get('api_key') or config.get('key'), 'api_key': self.module.params.get('api_key') or config.get('key'),
'api_timeout': self.module.params.get('api_timeout') or config.get('timeout'), 'api_timeout': self.module.params.get('api_timeout') or config.get('timeout') or 60,
'api_retries': self.module.params.get('api_retries') or config.get('retries'), 'api_retries': self.module.params.get('api_retries') or config.get('retries') or 5,
} }
# Common vultr returns # Common vultr returns

@ -16,12 +16,12 @@ options:
description: description:
- HTTP timeout to Vultr API. - HTTP timeout to Vultr API.
- The ENV variable C(VULTR_API_TIMEOUT) is used as default, when defined. - The ENV variable C(VULTR_API_TIMEOUT) is used as default, when defined.
default: 10 default: 60
api_retries: api_retries:
description: description:
- Amount of retries in case of the Vultr API retuns an HTTP 503 code. - Amount of retries in case of the Vultr API retuns an HTTP 503 code.
- The ENV variable C(VULTR_API_RETRIES) is used as default, when defined. - The ENV variable C(VULTR_API_RETRIES) is used as default, when defined.
default: 10 default: 5
api_account: api_account:
description: description:
- Name of the ini section in the C(vultr.ini) file. - Name of the ini section in the C(vultr.ini) file.
@ -30,7 +30,7 @@ options:
validate_certs: validate_certs:
description: description:
- Validate SSL certs of the Vultr API. - Validate SSL certs of the Vultr API.
default: true default: yes
type: bool type: bool
requirements: requirements:
- "python >= 2.6" - "python >= 2.6"

Loading…
Cancel
Save