Skip to content

Commit

Permalink
Merge pull request #54896 from twangboy/fix_win_lgpo
Browse files Browse the repository at this point in the history
Multiple LGPO Fixes
  • Loading branch information
dwoz authored Jan 6, 2020
2 parents 4fed7e0 + 16133ea commit 702557f
Show file tree
Hide file tree
Showing 8 changed files with 2,649 additions and 1,220 deletions.
2,064 changes: 1,417 additions & 647 deletions salt/modules/win_lgpo.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion salt/states/loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def until_no_eval(
current_attempt += 1
try:
res = __salt__[name](*args, **kwargs)
except Exception:
except Exception: # pylint: disable=broad-except
(exc_type, exc_value, _) = sys.exc_info()
ret['comment'] = 'Exception occurred while executing {}: {}:{}'.format(name, exc_type, exc_value)
break
Expand Down
238 changes: 131 additions & 107 deletions salt/states/win_lgpo.py

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion salt/utils/win_reg.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ def _to_unicode(vdata):
# None does not convert to Unicode
if vdata is None:
return None
if isinstance(vdata, int):
vdata = str(vdata)
return salt.utils.stringutils.to_unicode(vdata, 'utf-8')


Expand Down Expand Up @@ -522,7 +524,7 @@ def read_value(hive, key, vname=None, use_32bit_registry=False):
try:
# RegQueryValueEx returns and accepts unicode data
vdata, vtype = win32api.RegQueryValueEx(handle, local_vname)
if vdata or vdata in [0, '']:
if vdata or vdata in [0, '', []]:
# Only convert text types to unicode
ret['vtype'] = registry.vtype_reverse[vtype]
if vtype == win32con.REG_MULTI_SZ:
Expand Down
689 changes: 408 additions & 281 deletions tests/integration/modules/test_win_lgpo.py

Large diffs are not rendered by default.

Loading

0 comments on commit 702557f

Please sign in to comment.