Commit 3471c4fd authored by Pierre-Elliott Bécue's avatar Pierre-Elliott Bécue

On ajoute le serial dans le mapping des baies.

parent 03a6d1b9
......@@ -51,8 +51,8 @@ def get_mapping(baie_name):
map = {
""" % (sys.argv[0], baie)).encode(coding))
for lun, name in map:
f.write(' %d : "%s",\n' % (lun, name))
for lun, data in map:
f.write(' %d : %r,\n' % (lun, data))
f.write("}\n")
......
......@@ -121,12 +121,13 @@ class Nols(object):
name = None
lun = None
name = Object.findall("PROPERTY[@name='volume-name']")[0].text
serial = Object.findall("PROPERTY[@name='volume-serial']")[0].text
lun = Object.findall("OBJECT/PROPERTY[@name='lun']")[0].text
if lun is None:
pass
else:
map[int(lun)] = name
map[int(lun)] = (name, serial)
return map
def create_volume(self, name, size, unit="GiB", vdisk="slon1"):
......
......@@ -129,12 +129,13 @@ class Slon(object):
name = None
lun = None
name = Object.findall("volume_name")[0].text
serial = Object.findall("volume_serial")[0].text
lun = Object.findall("lun")[0].text
if lun is None:
pass
else:
map[int(lun)] = name
map[int(lun)] = (name, serial)
return map
def create_volume(self, name, size, unit="GB", vdisk="slon2"):
......
......@@ -41,7 +41,7 @@ def getname(device, baie):
globals()['map'] = {}
execfile(map_file, globals())
return map.get(lun, "lun%d" % lun) + part
return map.get(lun, "lun%d" % lun)[0] + part
if __name__ == '__main__':
if len(sys.argv) != 2:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment