Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] lgpo_reg state doesn't work with User policy #64200

Closed
twangboy opened this issue May 1, 2023 · 1 comment · Fixed by #64201
Closed

[BUG] lgpo_reg state doesn't work with User policy #64200

twangboy opened this issue May 1, 2023 · 1 comment · Fixed by #64201
Labels
Bug broken, incorrect, or confusing behavior lgpo Sulfur v3006.1 Windows

Comments

@twangboy
Copy link
Contributor

twangboy commented May 1, 2023

Description
The lgpo_reg state doesn't work when specifying the User policy class

Setup
Given the following state (mystate.sls):

set_reg_pol_value:
  lgpo_reg.value_present:
    - key: SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced
    - name: HideFileExt
    - v_data: 0
    - v_type: REG_DWORD
    - policy_class: User

Steps to Reproduce the behavior
Apply the state:

salt-call --local state.apply mystate

Expected behavior
The state should apply successfully

Screenshots

salt-call --local state.apply mystate
local:
----------
          ID: set_reg_pol_value
    Function: lgpo_reg.value_present
        Name: HideFileExt
      Result: False
     Comment: An exception occurred in this state: Traceback (most recent call last):
                File "C:\Program Files\Salt Project\Salt\lib\site-packages\salt\state.py", line 2385, in call
                  ret = self.states[cdata["full"]](
                File "C:\Program Files\Salt Project\Salt\lib\site-packages\salt\loader\lazy.py", line 149, in __call__
                  return self.loader.run(run_func, *args, **kwargs)
                File "C:\Program Files\Salt Project\Salt\lib\site-packages\salt\loader\lazy.py", line 1232, in run
                  return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
                File "C:\Program Files\Salt Project\Salt\lib\site-packages\salt\loader\lazy.py", line 1247, in _run_as
                  return _func_or_method(*args, **kwargs)
                File "C:\Program Files\Salt Project\Salt\lib\site-packages\salt\loader\lazy.py", line 1280, in wrapper
                  return f(*args, **kwargs)
                File "C:\Program Files\Salt Project\Salt\Lib\site-packages\salt\states\win_lgpo_reg.py", line 156, in value_present
                  if str(new["data"]) == v_data and new["type"] == v_type:
              KeyError: 'data'
     Started: 21:14:58.686519
    Duration: 101.512 ms
     Changes:

Summary for local
------------
Succeeded: 0
Failed:    1
------------
Total states run:     1
Total run time: 101.512 ms

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
3006.0
and head of 3006.x
@twangboy twangboy added Bug broken, incorrect, or confusing behavior needs-triage labels May 1, 2023
@twangboy twangboy added this to the Sulfur v3006.1 milestone May 1, 2023
@twangboy twangboy linked a pull request May 1, 2023 that will close this issue
3 tasks
@s0undt3ch
Copy link
Collaborator

Fix will be available in the upcoming 3006.1 release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior lgpo Sulfur v3006.1 Windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants