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

Fixes #17281
pull/16294/merge
jctanner 8 years ago committed by GitHub
parent 794c1636eb
commit 66426dcd38

@ -487,7 +487,10 @@ class VMWareInventory(object):
if vobj is None: if vobj is None:
rdata = None rdata = None
elif issubclass(type(vobj), str) or isinstance(vobj, str): 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): elif issubclass(type(vobj), bool) or isinstance(vobj, bool):
rdata = vobj rdata = vobj
elif issubclass(type(vobj), int) or isinstance(vobj, int): elif issubclass(type(vobj), int) or isinstance(vobj, int):

Loading…
Cancel
Save