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