Revision d6f8db24
b/lib/ovf.py | ||
---|---|---|
45 | 45 |
except ImportError: |
46 | 46 |
import elementtree.ElementTree as ET |
47 | 47 |
|
48 |
try: |
|
49 |
ParseError = ET.ParseError # pylint: disable=E1103 |
|
50 |
except AttributeError: |
|
51 |
ParseError = None |
|
52 |
|
|
48 | 53 |
from ganeti import constants |
49 | 54 |
from ganeti import errors |
50 | 55 |
from ganeti import utils |
... | ... | |
210 | 215 |
self.tree = ET.ElementTree() |
211 | 216 |
try: |
212 | 217 |
self.tree.parse(input_path) |
213 |
except xml.parsers.expat.ExpatError, err:
|
|
218 |
except (ParseError, xml.parsers.expat.ExpatError), err:
|
|
214 | 219 |
raise errors.OpPrereqError("Error while reading %s file: %s" % |
215 | 220 |
(OVF_EXT, err)) |
216 | 221 |
|
Also available in: Unified diff