mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Only convert text types in the list_values function
This commit is contained in:
parent
0e41535cdb
commit
872da3ffba
1 changed files with 7 additions and 1 deletions
|
@ -296,9 +296,15 @@ def list_values(hive, key=None, use_32bit_registry=False, include_default=True):
|
|||
value = {'hive': local_hive,
|
||||
'key': local_key,
|
||||
'vname': _to_mbcs(vname),
|
||||
'vdata': _to_mbcs(vdata),
|
||||
'vtype': registry.vtype_reverse[vtype],
|
||||
'success': True}
|
||||
# Only convert text types to unicode
|
||||
if vtype == win32con.REG_MULTI_SZ:
|
||||
value['vdata'] = [_to_mbcs(i) for i in vdata]
|
||||
elif vtype in [win32con.REG_SZ, win32con.REG_EXPAND_SZ]:
|
||||
value['vdata'] = _to_mbcs(vdata)
|
||||
else:
|
||||
value['vdata'] = vdata
|
||||
values.append(value)
|
||||
except pywintypes.error as exc: # pylint: disable=E0602
|
||||
log.debug(exc)
|
||||
|
|
Loading…
Add table
Reference in a new issue