Revision 29921401 lib/cmdlib.py
b/lib/cmdlib.py | ||
---|---|---|
26 | 26 |
import os |
27 | 27 |
import os.path |
28 | 28 |
import time |
29 |
import tempfile |
|
30 | 29 |
import re |
31 | 30 |
import platform |
32 | 31 |
import logging |
33 | 32 |
import copy |
34 |
import random |
|
35 | 33 |
|
36 | 34 |
from ganeti import ssh |
37 | 35 |
from ganeti import utils |
... | ... | |
40 | 38 |
from ganeti import locking |
41 | 39 |
from ganeti import constants |
42 | 40 |
from ganeti import objects |
43 |
from ganeti import opcodes |
|
44 | 41 |
from ganeti import serializer |
45 | 42 |
from ganeti import ssconf |
46 | 43 |
|
... | ... | |
637 | 634 |
|
638 | 635 |
""" |
639 | 636 |
if node is None: |
640 |
node=instance.primary_node
|
|
637 |
node = instance.primary_node
|
|
641 | 638 |
_CheckNicsBridgesExist(lu, instance.nics, node) |
642 | 639 |
|
643 | 640 |
|
... | ... | |
2582 | 2579 |
"master": cluster.master_node, |
2583 | 2580 |
"default_hypervisor": cluster.default_hypervisor, |
2584 | 2581 |
"enabled_hypervisors": cluster.enabled_hypervisors, |
2585 |
"hvparams": dict([(hypervisor, cluster.hvparams[hypervisor])
|
|
2586 |
for hypervisor in cluster.enabled_hypervisors]),
|
|
2582 |
"hvparams": dict([(hvname, cluster.hvparams[hvname])
|
|
2583 |
for hvname in cluster.enabled_hypervisors]),
|
|
2587 | 2584 |
"beparams": cluster.beparams, |
2588 | 2585 |
"nicparams": cluster.nicparams, |
2589 | 2586 |
"candidate_pool_size": cluster.candidate_pool_size, |
... | ... | |
4536 | 4533 |
bridge = nic.get("bridge", None) |
4537 | 4534 |
link = nic.get("link", None) |
4538 | 4535 |
if bridge and link: |
4539 |
raise errors.OpPrereqError("Cannot pass 'bridge' and 'link' at the same time") |
|
4536 |
raise errors.OpPrereqError("Cannot pass 'bridge' and 'link'" |
|
4537 |
" at the same time") |
|
4540 | 4538 |
elif bridge and nic_mode == constants.NIC_MODE_ROUTED: |
4541 | 4539 |
raise errors.OpPrereqError("Cannot pass 'bridge' on a routed nic") |
4542 | 4540 |
elif bridge: |
... | ... | |
5927 | 5925 |
nic_bridge = nic_dict.get('bridge', None) |
5928 | 5926 |
nic_link = nic_dict.get('link', None) |
5929 | 5927 |
if nic_bridge and nic_link: |
5930 |
raise errors.OpPrereqError("Cannot pass 'bridge' and 'link' at the same time") |
|
5928 |
raise errors.OpPrereqError("Cannot pass 'bridge' and 'link'" |
|
5929 |
" at the same time") |
|
5931 | 5930 |
elif nic_bridge and nic_bridge.lower() == constants.VALUE_NONE: |
5932 | 5931 |
nic_dict['bridge'] = None |
5933 | 5932 |
elif nic_link and nic_link.lower() == constants.VALUE_NONE: |
Also available in: Unified diff