Skip to content

Commit

Permalink
We need to handle XML parsing errors in UVE aggregation.
Browse files Browse the repository at this point in the history
Any attributes that cannot be parsed will be ignored.
Closes-Bug:1646696

Change-Id: I1fdb07475a6f312ed9e30782ffaa44a4dd3141f4
  • Loading branch information
anishmehta committed Dec 2, 2016
1 parent 908a65b commit 3eb017e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/opserver/uveserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,13 @@ def get_uve(self, key, flat, filters=None, base_url=None):
continue

if value[0] == '<':
snhdict = xmltodict.parse(value)
try:
snhdict = xmltodict.parse(value)
except:
self._logger.error("xml parsing failed key %s, struct %s: %s" \
% (key, typ, str(value)))
continue

if snhdict[attr]['@type'] == 'list':
sname = ParallelAggregator.get_list_name(
snhdict[attr])
Expand Down

0 comments on commit 3eb017e

Please sign in to comment.