diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index fc05dfe9d019dbd8083c63194b1f659dca8027f7..3ddc5bd69b0481ebce098460afa9e23c6af48de4 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 c34904806002dce648582c9066fa8e612e53dc4d..4de8a949b920456a6d00310b802c0074c7e2eb3a 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 6b77754b4a911a6398fa3a5869995e228e9a9e1a..4384655f68819922ee1e97aed66073050ef0b7d4 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 bd1bbf531df18d2d4cdc64341415997683ca48d0..d681b0d68bb76553422e421e78622b3fae22fbc1 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)