Skip to content

[BUG] git.config_unset KeyError exception #65715

Open
@genaumann

Description

@genaumann

I am trying to use the git.config_unset state.
This state throws the following error:

File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/state.py", line 2423, in call
                  ret = self.states[cdata["full"]](
                File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 159, in __call__
                  ret = self.loader.run(run_func, *args, **kwargs)
                File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1245, in run
                  return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
                File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1260, in _run_as
                  return _func_or_method(*args, **kwargs)
                File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1293, in wrapper
                  return f(*args, **kwargs)
                File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/git.py", line 3050, in config_unset
                  unset = [x for x in pre[key_name] if x not in post[key_name]]
                File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/git.py", line 3050, in <listcomp>
                  unset = [x for x in pre[key_name] if x not in post[key_name]]
              KeyError: 'core.filemode'

The issue is present since years.
See the following issues / PR:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugbroken, incorrect, or confusing behaviorneeds-triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions