feat: add throttle option to corenetworks_dns module
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Robert Kaussow 2021-02-19 13:38:30 +01:00
parent 742aed260a
commit c024883a2b
Signed by: xoxys
GPG Key ID: 65362AE74AF98B61
6 changed files with 30 additions and 10 deletions

View File

@ -83,6 +83,15 @@ local PipelineBuild = {
'cd dist/ && sha256sum * > ../sha256sum.txt',
],
},
{
name: 'changelog',
image: 'thegeeklab/git-chglog',
commands: [
'git fetch -tq',
'git-chglog --no-color --no-emoji ${DRONE_TAG:---next-tag unreleased unreleased}',
'git-chglog --no-color --no-emoji -o CHANGELOG.md ${DRONE_TAG:---next-tag unreleased unreleased}',
],
},
{
name: 'publish-gitea',
image: 'plugins/gitea-release',

View File

@ -103,6 +103,13 @@ steps:
commands:
- cd dist/ && sha256sum * > ../sha256sum.txt
- name: changelog
image: thegeeklab/git-chglog
commands:
- git fetch -tq
- git-chglog --no-color --no-emoji ${DRONE_TAG:---next-tag unreleased unreleased}
- git-chglog --no-color --no-emoji -o CHANGELOG.md ${DRONE_TAG:---next-tag unreleased unreleased}
- name: publish-gitea
image: plugins/gitea-release
settings:
@ -192,6 +199,6 @@ depends_on:
---
kind: signature
hmac: 183bee0f94387357e4cb3c1f4c38c47e0b12318e3ed0cbde2637c36dea06e38e
hmac: ccd6854d77f9c42527ab5ca2b8337c8ee904fc917b9b229e2761352f578b35e6
...

1
.gitignore vendored
View File

@ -107,3 +107,4 @@ docs/themes/
docs/public/
resources/_gen/
CHANGELOG.md

View File

@ -1,6 +0,0 @@
- BUGFIX
- fix typos
- add missing defaults for parameters
- ENHANCEMENT
- add parameter `verify_ssl` (default: true)
- add parameter `auth_timeout` (default: 5)

View File

@ -61,6 +61,11 @@ options:
- Only use with C(state=present).
- This will delete all other records with the same record name and type.
type: bool
throttle:
description:
- Throttle API calls in seconds.
default: 2
type: int
state:
description:
- whether the record should exist or not
@ -111,6 +116,7 @@ EXAMPLES = """
RETURN = r"""# """
import copy
import time
import traceback
CORENETWORKS_IMP_ERR = None
@ -206,6 +212,7 @@ def main():
ttl = module.params.get("ttl")
value = module.params.get("value")
state = module.params.get("state")
throttle = module.params.get("throttle")
is_solo = module.params.get("solo")
params = {"name": record, "ttl": ttl}
@ -227,7 +234,9 @@ def main():
# perform actions
try:
# request throtteling to workaround the current rate limit
# request throttling to workaround the rate limit
time.sleep(throttle)
changed = False
if api_token:
client = CoreNetworks(api_token=api_token, auto_commit=True)

View File

@ -4,7 +4,7 @@ known_first_party = ansiblelater
sections = FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
force_single_line = true
line_length = 99
skip_glob = **/.env*,**/env/*,**/docs/*,**/inventory/*,**/modules/*
skip_glob = **/.venv*,**/venv/*,**/docs/*,**/inventory/*,**/modules/*
[yapf]
based_on_style = google
@ -22,4 +22,4 @@ filterwarnings =
[coverage:run]
omit =
**/test/*
**/.env/*
**/.venv/*