Merge pull request #45468 from twangboy/win_reg

Fix some issues with reg.py
This commit is contained in:
Nicole Thomas 2018-01-16 17:23:46 -05:00 committed by GitHub
commit ee5090f69b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -382,10 +382,18 @@ def read_value(hive, key, vname=None, use_32bit_registry=False):
except WindowsError: # pylint: disable=E0602
ret['vdata'] = ('(value not set)')
ret['vtype'] = 'REG_SZ'
except pywintypes.error as exc: # pylint: disable=E0602
msg = 'Cannot find {0} in {1}\\{2}' \
''.format(local_vname, local_hive, local_key)
log.trace(exc)
log.trace(msg)
ret['comment'] = msg
ret['success'] = False
except pywintypes.error as exc: # pylint: disable=E0602
log.debug(exc)
log.debug('Cannot find key: {0}\\{1}'.format(local_hive, local_key))
ret['comment'] = 'Cannot find key: {0}\\{1}'.format(local_hive, local_key)
msg = 'Cannot find key: {0}\\{1}'.format(local_hive, local_key)
log.trace(exc)
log.trace(msg)
ret['comment'] = msg
ret['success'] = False
return ret