On peut dsormais ajouter des intervalles de ports.
darcs-hash:20060327142621-68412-58a80a281a257a0904db80763735b6e99afbef1f.gz
This commit is contained in:
parent
113bb63550
commit
5ddcc97c26
1 changed files with 12 additions and 2 deletions
|
@ -2636,9 +2636,19 @@ class Machine(base_classes_crans):
|
||||||
if ports == None:
|
if ports == None:
|
||||||
return self._data.get(champ, [])
|
return self._data.get(champ, [])
|
||||||
|
|
||||||
ports = map(int, ports)
|
# Les ports doivent être de la forme [port][:[port]]. On met
|
||||||
|
# la spécification sous une forme qui donne un tri intéressant
|
||||||
|
def parse(x):
|
||||||
|
try:
|
||||||
|
liste = x.split(':')
|
||||||
|
assert(len(liste) == 1 or len(liste) == 2)
|
||||||
|
return map(lambda x: x and int(x) or '', liste)
|
||||||
|
except:
|
||||||
|
raise ValueError(u'Spécification de ports incorrecte : %s' % x)
|
||||||
|
|
||||||
|
ports = map(parse, ports)
|
||||||
ports.sort()
|
ports.sort()
|
||||||
self._set(champ, map(str, ports))
|
self._set(champ, map(lambda x: ':'.join(map(str, x)), ports))
|
||||||
|
|
||||||
|
|
||||||
class MachineFixe(Machine):
|
class MachineFixe(Machine):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue