Revision 0af0f641
b/lib/cli.py | ||
---|---|---|
1536 | 1536 |
elif opts.no_nics: |
1537 | 1537 |
# no nics |
1538 | 1538 |
nics = [] |
1539 |
else:
|
|
1539 |
elif mode == constants.INSTANCE_CREATE:
|
|
1540 | 1540 |
# default of one nic, all auto |
1541 | 1541 |
nics = [{}] |
1542 |
else: |
|
1543 |
# mode == import |
|
1544 |
nics = [] |
|
1542 | 1545 |
|
1543 | 1546 |
if opts.disk_template == constants.DT_DISKLESS: |
1544 | 1547 |
if opts.disks or opts.sd_size is not None: |
b/lib/cmdlib.py | ||
---|---|---|
6278 | 6278 |
" is missing the disk information", |
6279 | 6279 |
errors.ECODE_INVAL) |
6280 | 6280 |
|
6281 |
if (not self.op.nics and |
|
6282 |
einfo.has_option(constants.INISECT_INS, "nic_count")): |
|
6283 |
nics = [] |
|
6284 |
for idx in range(einfo.getint(constants.INISECT_INS, "nic_count")): |
|
6285 |
ndict = {} |
|
6286 |
for name in list(constants.NICS_PARAMETERS) + ["ip", "mac"]: |
|
6287 |
v = einfo.get(constants.INISECT_INS, "nic%d_%s" % (idx, name)) |
|
6288 |
ndict[name] = v |
|
6289 |
nics.append(ndict) |
|
6290 |
self.op.nics = nics |
|
6291 |
|
|
6281 | 6292 |
if (self.op.hypervisor is None and |
6282 | 6293 |
einfo.has_option(constants.INISECT_INS, "hypervisor")): |
6283 | 6294 |
self.op.hypervisor = einfo.get(constants.INISECT_INS, "hypervisor") |
Also available in: Unified diff