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

Multiple LGPO Fixes #54896

Merged
merged 14 commits into from
Jan 6, 2020
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