Revision fdbe29ee
b/lib/client/gnt_debug.py | ||
---|---|---|
129 | 129 |
|
130 | 130 |
""" |
131 | 131 |
try: |
132 |
disks = [{"size": utils.ParseUnit(val), "mode": 'w'} |
|
133 |
for val in opts.disks.split(",")] |
|
132 |
disks = [{ |
|
133 |
constants.IDISK_SIZE: utils.ParseUnit(val), |
|
134 |
constants.IDISK_MODE: constants.DISK_RDWR, |
|
135 |
} for val in opts.disks.split(",")] |
|
134 | 136 |
except errors.UnitParseError, err: |
135 | 137 |
ToStderr("Invalid disks parameter '%s': %s", opts.disks, err) |
136 | 138 |
return 1 |
... | ... | |
142 | 144 |
for i in range(3): |
143 | 145 |
if row[i] == '': |
144 | 146 |
row[i] = None |
145 |
nic_dict = [{"mac": v[0], "ip": v[1], "bridge": v[2]} for v in nics] |
|
147 |
nic_dict = [{ |
|
148 |
constants.INIC_MAC: v[0], |
|
149 |
constants.INIC_IP: v[1], |
|
150 |
# The iallocator interface defines a "bridge" item |
|
151 |
"bridge": v[2], |
|
152 |
} for v in nics] |
|
146 | 153 |
|
147 | 154 |
if opts.tags is None: |
148 | 155 |
opts.tags = [] |
b/lib/opcodes.py | ||
---|---|---|
1418 | 1418 |
("mode", ht.NoDefault, ht.TElemOf(constants.VALID_IALLOCATOR_MODES), None), |
1419 | 1419 |
("name", ht.NoDefault, ht.TNonEmptyString, None), |
1420 | 1420 |
("nics", ht.NoDefault, ht.TOr(ht.TNone, ht.TListOf( |
1421 |
ht.TDictOf(ht.TElemOf(["mac", "ip", "bridge"]),
|
|
1421 |
ht.TDictOf(ht.TElemOf([constants.INIC_MAC, constants.INIC_IP, "bridge"]),
|
|
1422 | 1422 |
ht.TOr(ht.TNone, ht.TNonEmptyString)))), None), |
1423 | 1423 |
("disks", ht.NoDefault, ht.TOr(ht.TNone, ht.TList), None), |
1424 | 1424 |
("hypervisor", None, ht.TMaybeString, None), |
Also available in: Unified diff