Revision 81c222af lib/cmdlib/instance.py
b/lib/cmdlib/instance.py | ||
---|---|---|
1 | 1 |
# |
2 | 2 |
# |
3 | 3 |
|
4 |
# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Google Inc. |
|
4 |
# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Google Inc.
|
|
5 | 5 |
# |
6 | 6 |
# This program is free software; you can redistribute it and/or modify |
7 | 7 |
# it under the terms of the GNU General Public License as published by |
... | ... | |
431 | 431 |
raise errors.OpPrereqError("Cannot do IP address check without a name" |
432 | 432 |
" check", errors.ECODE_INVAL) |
433 | 433 |
|
434 |
# add nic for instance communication |
|
435 |
if self.op.instance_communication: |
|
436 |
nic_name = "%s%s" % (constants.INSTANCE_COMMUNICATION_NIC_PREFIX, |
|
437 |
self.op.instance_name) |
|
438 |
communication_network = constants.INSTANCE_COMMUNICATION_NETWORK |
|
439 |
|
|
440 |
self.op.nics.append({constants.INIC_NAME: nic_name, |
|
441 |
constants.INIC_MAC: constants.VALUE_GENERATE, |
|
442 |
constants.INIC_IP: constants.NIC_IP_POOL, |
|
443 |
constants.INIC_NETWORK: communication_network}) |
|
444 |
|
|
434 | 445 |
# check nics' parameter names |
435 | 446 |
for nic in self.op.nics: |
436 | 447 |
utils.ForceDictType(nic, constants.INIC_PARAMS_TYPES) |
Also available in: Unified diff