From af9c060e1c59d24bddaf328adc396f920f1fd48c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Elliott=20B=C3=A9cue?= Date: Wed, 8 Aug 2012 00:41:20 +0200 Subject: [PATCH] =?UTF-8?q?[Je=20suis=20une=20foug=C3=A8re]=20Oubli=20dans?= =?UTF-8?q?=20nolslib.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ignore-this: f4f042b07f36f7b71019048ed5c10b49 darcs-hash:20120807224120-b6762-c4eba9c450ee6fe9046d2c6798159e8df20c8370.gz --- gestion/iscsi/nolslib.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/gestion/iscsi/nolslib.py b/gestion/iscsi/nolslib.py index 1efc29b0..33996560 100755 --- a/gestion/iscsi/nolslib.py +++ b/gestion/iscsi/nolslib.py @@ -99,12 +99,22 @@ class Nols(object): XML_map = self.cmd("show volume-map", mode="XML") root = fromstring(XML_map) tree = ElementTree(root) - Objects = tree.findall("OBJECT[@name='volume-view']") + + ## Cf juste en dessous + Objects = tree.findall("OBJECT") + #Objects = tree.findall("OBJECT[@name='volume-view']") + ## Fin cf juste en dessous + for Object in Objects: # Quand on passera à wheezy, décommenter ces lignes, et virer # la merde que j'ai fait juste après. #name = Object.findall("PROPERTY[@name='volume-name']")[0].text #lun = Object.findall("OBJECT/PROPERTY[@name='lun']")[0].text + + ######## Début merde que j'ai faite juste après ########### + if not (Object.attrib['name'] == "volume-view"): + pass + properties = Object.findall("PROPERTY") for property in properties: if property.attrib['name'] == "volume-name": @@ -120,6 +130,8 @@ class Nols(object): lun = property.text else: pass + ####### Fin merde que j'ai faite juste après ############# + if lun is None: pass