diff --git a/.drone.jsonnet b/.drone.jsonnet index 6a5e2b0..69c9d8a 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -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', diff --git a/.drone.yml b/.drone.yml index be414d0..3d8a66b 100644 --- a/.drone.yml +++ b/.drone.yml @@ -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 ... diff --git a/.gitignore b/.gitignore index d55068e..3d8498e 100644 --- a/.gitignore +++ b/.gitignore @@ -107,3 +107,4 @@ docs/themes/ docs/public/ resources/_gen/ +CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index ba50742..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -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) diff --git a/plugins/modules/corenetworks_dns.py b/plugins/modules/corenetworks_dns.py index 63ccf71..fbe6cc6 100644 --- a/plugins/modules/corenetworks_dns.py +++ b/plugins/modules/corenetworks_dns.py @@ -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) diff --git a/setup.cfg b/setup.cfg index 6d6fb61..10fc1f1 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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/*