diff options
author | Chuck Short <chuck.short@canonical.com> | 2012-04-30 13:52:37 -0400 |
---|---|---|
committer | Chuck Short <chuck.short@canonical.com> | 2012-04-30 15:10:19 -0400 |
commit | 7a5c505a3bc22a1542791b6f32ceaf0f0ec17a63 (patch) | |
tree | a4f5588a2eec22ad02b1a1d7ef591fdbd59931cb /nova/volume | |
parent | 1c127f79c3331bc74b0b74c4eade87be695a8828 (diff) | |
download | nova-7a5c505a3bc22a1542791b6f32ceaf0f0ec17a63.tar.gz nova-7a5c505a3bc22a1542791b6f32ceaf0f0ec17a63.tar.xz nova-7a5c505a3bc22a1542791b6f32ceaf0f0ec17a63.zip |
Clean up ElementTree usage
Use lxml in favor of ElementTree to
make things more consistent.
Fixes LP: #953449
Change-Id: I7f48528d7df47fe7207ca88bce196dea7535df0e
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Diffstat (limited to 'nova/volume')
-rw-r--r-- | nova/volume/san.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/nova/volume/san.py b/nova/volume/san.py index 1d5a36057..aecb9a0b5 100644 --- a/nova/volume/san.py +++ b/nova/volume/san.py @@ -30,7 +30,8 @@ import random import socket import string import uuid -from xml.etree import ElementTree + +from lxml import etree from nova import exception from nova import flags @@ -145,7 +146,7 @@ class SanISCSIDriver(nova.volume.driver.ISCSIDriver): pass def check_for_setup_error(self): - """Returns an error if prerequisites aren't met""" + """Returns an error if prerequisites aren't met.""" if not self.run_local: if not (FLAGS.san_password or FLAGS.san_private_key): raise exception.Error(_('Specify san_password or ' @@ -451,7 +452,7 @@ class HpSanISCSIDriver(SanISCSIDriver): LOG.debug(_("CLIQ command returned %s"), out) - result_xml = ElementTree.fromstring(out) + result_xml = etree.fromstring(out) if check_cliq_result: response_node = result_xml.find("response") if response_node is None: @@ -492,7 +493,7 @@ class HpSanISCSIDriver(SanISCSIDriver): if len(vips) == 1: return vips[0] - _xml = ElementTree.tostring(cluster_xml) + _xml = etree.tostring(cluster_xml) msg = (_("Unexpected number of virtual ips for cluster " " %(cluster_name)s. Result=%(_xml)s") % locals()) |