Use internal key when checking keys to pop.
@@ -189,7 +189,9 @@ def pop_global_arguments(state, host, kwargs, keys_to_check=None):
for _, kwarg_configs in OPERATION_KWARGS.items():
for key, config in kwarg_configs.items():
- if keys_to_check and key not in keys_to_check:
+ internal_key = _get_internal_key(key)
+
+ if keys_to_check and internal_key not in keys_to_check:
continue
handler = None
@@ -201,8 +203,6 @@ def pop_global_arguments(state, host, kwargs, keys_to_check=None):
if default:
default = default(state.config)
- internal_key = _get_internal_key(key)
-
host_default = getattr(host.data, key, None)
# COMPAT w/<v3
