Merge pull request #44861 from twangboy/win_fix_lgpo_invalid_value

Fix win_lgpo for unknown values
This commit is contained in:
Nicole Thomas 2017-12-08 13:52:04 -05:00 committed by GitHub
commit dc51174670
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2435,15 +2435,18 @@ class _policy_info(object):
'''
converts a binary 0/1 to Disabled/Enabled
'''
if val is not None:
if ord(val) == 0:
return 'Disabled'
elif ord(val) == 1:
return 'Enabled'
try:
if val is not None:
if ord(val) == 0:
return 'Disabled'
elif ord(val) == 1:
return 'Enabled'
else:
return 'Invalid Value'
else:
return 'Invalid Value'
else:
return 'Not Defined'
return 'Not Defined'
except TypeError:
return 'Invalid Value'
@classmethod
def _binary_enable_zero_disable_one_reverse_conversion(cls, val, **kwargs):