vmware_inventory: decode strings to ascii if not alphanumeric (#17618)

Fixes #17281
This commit is contained in:
jctanner 2016-09-16 17:09:42 -04:00 committed by GitHub
parent 794c1636eb
commit 66426dcd38

View file

@ -487,7 +487,10 @@ class VMWareInventory(object):
if vobj is None:
rdata = None
elif issubclass(type(vobj), str) or isinstance(vobj, str):
rdata = vobj
if vobj.isalnum():
rdata = vobj
else:
rdata = vobj.decode('ascii', 'ignore')
elif issubclass(type(vobj), bool) or isinstance(vobj, bool):
rdata = vobj
elif issubclass(type(vobj), int) or isinstance(vobj, int):