Change in vdsm[master]: hostdev: decode XML string when parsing devices

mpolednik at redhat.com mpolednik at redhat.com
Wed Mar 16 15:18:57 UTC 2016


Martin Polednik has posted comments on this change.

Change subject: hostdev: decode XML string when parsing devices
......................................................................


Patch Set 1:

(2 comments)

https://gerrit.ovirt.org/#/c/54802/1//COMMIT_MSG
Commit Message:

Line 10: ascii
> why is that? I would assume that UTF8 is likely to be used if a crazy BIOS 
Simple answer would be "we can't know". Speaking of which, BIOS should not ever use non-ascii characters, and issue in this case is more likely invalid XML character rather than character in different encoding.


https://gerrit.ovirt.org/#/c/54802/1/lib/vdsm/hostdev.py
File lib/vdsm/hostdev.py:

Line 118:                       'usb_device': _parse_usb_address}
Line 119: 
Line 120:     params = {}
Line 121: 
Line 122:     devXML = etree.fromstring(device_xml.decode('ascii', errors='ignore'))
> I think that 'replace' would give the user a hint about information
See the other comment - it's most likely case of un-printable characters. Those would be displayed as escaped hex codes, which may rather devalue the information user sees.
Line 123:     name = devXML.find('name').text
Line 124:     if name != 'computer':
Line 125:         params['parent'] = devXML.find('parent').text
Line 126: 


-- 
To view, visit https://gerrit.ovirt.org/54802
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iaf9b9699790c83bb82a88a700c63d05604588d02
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Polednik <mpolednik at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Edward Haas <edwardh at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik <mpolednik at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list