diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index fc05dfe9..3ddc5bd6 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -30,4 +30,4 @@ jobs: uses: ibiqlik/action-yamllint@v1 - name: Run Python linters - uses: rjeffman/python-lint-action@master + uses: rjeffman/python-lint-action@v2 diff --git a/plugins/modules/ipadnsrecord.py b/plugins/modules/ipadnsrecord.py index c3490480..4de8a949 100644 --- a/plugins/modules/ipadnsrecord.py +++ b/plugins/modules/ipadnsrecord.py @@ -1375,10 +1375,9 @@ def define_commands_for_present_state(module, zone_name, entry, res_find): # remove record from args, as it will not be used again. del args[record] else: - for f in part_fields: - _args = {k: args[k] for k in part_fields} - _args['idnsname'] = name - _commands.append([zone_name, 'dnsrecord_add', _args]) + _args = {k: args[k] for k in part_fields if k in args} + _args['idnsname'] = name + _commands.append([zone_name, 'dnsrecord_add', _args]) # clean used fields from args for f in part_fields: if f in args: diff --git a/requirements-dev.txt b/requirements-dev.txt index 6b77754b..4384655f 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,3 +1,4 @@ -r requirements-tests.txt ipdb pre-commit +flake8-bugbear diff --git a/tests/utils.py b/tests/utils.py index bd1bbf53..d681b0d6 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -169,7 +169,7 @@ def list_test_yaml(dir_path): `test_` and the extension is `.yml`. """ yamls = [] - for root, dirs, files in os.walk(dir_path): + for root, _dirs, files in os.walk(dir_path): for yaml_name in files: if yaml_name.startswith("test_") and yaml_name.endswith(".yml"): test_yaml_path = os.path.join(root, yaml_name)