Commit 66206178 authored by Pierre-Elliott Bécue's avatar Pierre-Elliott Bécue
Browse files

[iscsi] On ne print "OK" ou "ÉCHEC" que si c'est vraiment le cas.

parent 5f98e6d5
......@@ -53,32 +53,32 @@ def make_link(couple):
sys.stdout.write("Création du lien /dev/" + sym + " -> /dev/" + dev + " … ")
try:
os.symlink(dev, sym)
sys.stdout.write(coul("OK", 'vert'))
res.append(True)
sys.stdout.write(coul("OK", 'vert'))
except:
sys.stdout.write(coul("ECHEC", 'rouge'))
res.append(False)
sys.stdout.write(coul("ECHEC", 'rouge'))
sys.stdout.write('\n')
elif os.path.islink(sym) and ('empty' in diskstatus or 'ERROR' in diskstatus):
sys.stdout.write("Destruction du lien /dev/" + sym + " … ")
try:
os.remove(sym)
sys.stdout.write(coul("OK", 'vert'))
res.append(True)
sys.stdout.write(coul("OK", 'vert'))
except:
sys.stdout.write(coul("ECHEC", 'rouge'))
res.append(False)
sys.stdout.write(coul("ECHEC", 'rouge'))
sys.stdout.write('\n')
elif os.path.islink(sym) and os.readlink(sym) != dev:
sys.stdout.write("Mise à jour du lien /dev/" + sym + " -> /dev/" + dev + " … ")
try:
os.remove(sym)
os.symlink(dev, sym)
res.append(True)
sys.stdout.write(coul("OK", 'vert'))
res.ppend(True)
except:
sys.stdout.write(coul("ECHEC", 'rouge'))
res.append(False)
sys.stdout.write(coul("ECHEC", 'rouge'))
sys.stdout.write('\n')
else:
res.append(None)
......
Supports Markdown
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