Commit 3c286190 authored by Dimitris Aragiorgis's avatar Dimitris Aragiorgis Committed by Iustin Pop
Browse files

Fixes to pass pep8 (make lint)


Signed-off-by: default avatarDimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent beb81ea5
...@@ -541,6 +541,7 @@ def main(): ...@@ -541,6 +541,7 @@ def main():
[socat_stderr_write_fd, dd_stderr_write_fd, [socat_stderr_write_fd, dd_stderr_write_fd,
dd_pid_write_fd, exp_size_write_fd]) dd_pid_write_fd, exp_size_write_fd])
try: try:
def _ForwardSignal(signum, _): def _ForwardSignal(signum, _):
"""Forwards signals to child process. """Forwards signals to child process.
......
...@@ -373,6 +373,7 @@ class ArgNetwork(_Argument): ...@@ -373,6 +373,7 @@ class ArgNetwork(_Argument):
""" """
class ArgGroup(_Argument): class ArgGroup(_Argument):
"""Node group argument. """Node group argument.
......
...@@ -495,7 +495,7 @@ def TestJobqueue(opts, _): ...@@ -495,7 +495,7 @@ def TestJobqueue(opts, _):
opcodes.OpTestJqueue(notify_waitlock=True, opcodes.OpTestJqueue(notify_waitlock=True,
notify_exec=True, notify_exec=True,
log_messages=test_messages, log_messages=test_messages,
fail=fail) fail=fail),
] ]
expect_messages = [test_messages] expect_messages = [test_messages]
expect_resultlen = 1 expect_resultlen = 1
......
...@@ -44,6 +44,7 @@ def _HandleReservedIPs(ips): ...@@ -44,6 +44,7 @@ def _HandleReservedIPs(ips):
return utils.UnescapeAndSplit(ips, sep=",") return utils.UnescapeAndSplit(ips, sep=",")
return None return None
def AddNetwork(opts, args): def AddNetwork(opts, args):
"""Add a network to the cluster. """Add a network to the cluster.
...@@ -61,16 +62,16 @@ def AddNetwork(opts, args): ...@@ -61,16 +62,16 @@ def AddNetwork(opts, args):
else: else:
tags = [] tags = []
op = opcodes.OpNetworkAdd(network_name=network_name, op = opcodes.OpNetworkAdd(
gateway=opts.gateway, network_name=network_name,
network=opts.network, gateway=opts.gateway,
gateway6=opts.gateway6, network=opts.network,
network6=opts.network6, gateway6=opts.gateway6,
mac_prefix=opts.mac_prefix, network6=opts.network6,
network_type=opts.network_type, mac_prefix=opts.mac_prefix,
add_reserved_ips=\ network_type=opts.network_type,
_HandleReservedIPs(opts.add_reserved_ips), add_reserved_ips=_HandleReservedIPs(opts.add_reserved_ips),
tags=tags) tags=tags)
SubmitOpCode(op, opts=opts) SubmitOpCode(op, opts=opts)
...@@ -202,7 +203,7 @@ def ShowNetworkConfig(_, args): ...@@ -202,7 +203,7 @@ def ShowNetworkConfig(_, args):
ToStdout(" type: %s", network_type) ToStdout(" type: %s", network_type)
ToStdout(" size: %d", size) ToStdout(" size: %d", size)
ToStdout(" free: %d (%.2f%%)", free_count, ToStdout(" free: %d (%.2f%%)", free_count,
100 * float(free_count)/float(size)) 100 * float(free_count) / float(size))
ToStdout(" usage map:") ToStdout(" usage map:")
idx = 0 idx = 0
for line in wrap(mapping, width=64): for line in wrap(mapping, width=64):
...@@ -229,7 +230,7 @@ def ShowNetworkConfig(_, args): ...@@ -229,7 +230,7 @@ def ShowNetworkConfig(_, args):
["nic.ips", "nic.networks"], ["nic.ips", "nic.networks"],
use_locking=False) use_locking=False)
l = lambda value: ", ".join(str(idx)+":"+str(ip) l = lambda value: ", ".join(str(idx) + ":" + str(ip)
for idx, (ip, net) in enumerate(value) for idx, (ip, net) in enumerate(value)
if net == name) if net == name)
......
...@@ -2037,7 +2037,7 @@ class LUClusterVerify(NoHooksLU): ...@@ -2037,7 +2037,7 @@ class LUClusterVerify(NoHooksLU):
   
# Verify global configuration # Verify global configuration
jobs.append([ jobs.append([
opcodes.OpClusterVerifyConfig(ignore_errors=self.op.ignore_errors) opcodes.OpClusterVerifyConfig(ignore_errors=self.op.ignore_errors),
]) ])
   
# Always depend on global verification # Always depend on global verification
...@@ -3189,7 +3189,7 @@ class LUClusterVerifyGroup(LogicalUnit, _VerifyErrors): ...@@ -3189,7 +3189,7 @@ class LUClusterVerifyGroup(LogicalUnit, _VerifyErrors):
   
""" """
env = { env = {
"CLUSTER_TAGS": " ".join(self.cfg.GetClusterInfo().GetTags()) "CLUSTER_TAGS": " ".join(self.cfg.GetClusterInfo().GetTags()),
} }
   
env.update(("NODE_TAGS_%s" % node.name, " ".join(node.GetTags())) env.update(("NODE_TAGS_%s" % node.name, " ".join(node.GetTags()))
...@@ -8200,8 +8200,7 @@ class LUNodeMigrate(LogicalUnit): ...@@ -8200,8 +8200,7 @@ class LUNodeMigrate(LogicalUnit):
target_node=self.op.target_node, target_node=self.op.target_node,
allow_runtime_changes=allow_runtime_changes, allow_runtime_changes=allow_runtime_changes,
ignore_ipolicy=self.op.ignore_ipolicy)] ignore_ipolicy=self.op.ignore_ipolicy)]
for inst in _GetNodePrimaryInstances(self.cfg, self.op.node_name) for inst in _GetNodePrimaryInstances(self.cfg, self.op.node_name)]
]
   
# TODO: Run iallocator in this opcode and pass correct placement options to # TODO: Run iallocator in this opcode and pass correct placement options to
# OpInstanceMigrate. Since other jobs can modify the cluster between # OpInstanceMigrate. Since other jobs can modify the cluster between
...@@ -9115,9 +9114,11 @@ def _GenerateDiskTemplate( ...@@ -9115,9 +9114,11 @@ def _GenerateDiskTemplate(
for i in range(disk_count)]) for i in range(disk_count)])
   
if template_name == constants.DT_PLAIN: if template_name == constants.DT_PLAIN:
def logical_id_fn(idx, _, disk): def logical_id_fn(idx, _, disk):
vg = disk.get(constants.IDISK_VG, vgname) vg = disk.get(constants.IDISK_VG, vgname)
return (vg, names[idx]) return (vg, names[idx])
elif template_name in (constants.DT_FILE, constants.DT_SHARED_FILE): elif template_name in (constants.DT_FILE, constants.DT_SHARED_FILE):
logical_id_fn = \ logical_id_fn = \
lambda _, disk_index, disk: (file_driver, lambda _, disk_index, disk: (file_driver,
...@@ -10292,7 +10293,6 @@ class LUInstanceCreate(LogicalUnit): ...@@ -10292,7 +10293,6 @@ class LUInstanceCreate(LogicalUnit):
if self.op.conflicts_check: if self.op.conflicts_check:
_CheckForConflictingIp(self, nic.ip, self.pnode.name) _CheckForConflictingIp(self, nic.ip, self.pnode.name)
   
# mirror node verification # mirror node verification
if self.op.disk_template in constants.DTS_INT_MIRROR: if self.op.disk_template in constants.DTS_INT_MIRROR:
if self.op.snode == pnode.name: if self.op.snode == pnode.name:
...@@ -12045,8 +12045,7 @@ class LUNodeEvacuate(NoHooksLU): ...@@ -12045,8 +12045,7 @@ class LUNodeEvacuate(NoHooksLU):
disks=[], disks=[],
mode=constants.REPLACE_DISK_CHG, mode=constants.REPLACE_DISK_CHG,
early_release=self.op.early_release)] early_release=self.op.early_release)]
for instance_name in self.instance_names for instance_name in self.instance_names]
]
   
else: else:
raise errors.ProgrammerError("No iallocator or remote node") raise errors.ProgrammerError("No iallocator or remote node")
...@@ -12957,6 +12956,7 @@ class LUInstanceSetParams(LogicalUnit): ...@@ -12957,6 +12956,7 @@ class LUInstanceSetParams(LogicalUnit):
" in cluster" % mac, " in cluster" % mac,
errors.ECODE_NOTUNIQUE) errors.ECODE_NOTUNIQUE)
elif new_net != old_net: elif new_net != old_net:
def get_net_prefix(net): def get_net_prefix(net):
if net: if net:
uuid = self.cfg.LookupNetwork(net) uuid = self.cfg.LookupNetwork(net)
...@@ -12964,6 +12964,7 @@ class LUInstanceSetParams(LogicalUnit): ...@@ -12964,6 +12964,7 @@ class LUInstanceSetParams(LogicalUnit):
nobj = self.cfg.GetNetwork(uuid) nobj = self.cfg.GetNetwork(uuid)
return nobj.mac_prefix return nobj.mac_prefix
return None return None
new_prefix = get_net_prefix(new_net) new_prefix = get_net_prefix(new_net)
old_prefix = get_net_prefix(old_net) old_prefix = get_net_prefix(old_net)
if old_prefix != new_prefix: if old_prefix != new_prefix:
...@@ -15551,6 +15552,7 @@ class LUTestAllocator(NoHooksLU): ...@@ -15551,6 +15552,7 @@ class LUTestAllocator(NoHooksLU):
result = ial.out_text result = ial.out_text
return result return result
   
# Network LUs # Network LUs
class LUNetworkAdd(LogicalUnit): class LUNetworkAdd(LogicalUnit):
"""Logical unit for creating networks. """Logical unit for creating networks.
...@@ -15590,13 +15592,12 @@ class LUNetworkAdd(LogicalUnit): ...@@ -15590,13 +15592,12 @@ class LUNetworkAdd(LogicalUnit):
self.op.network, errors.ECODE_EXISTS) self.op.network, errors.ECODE_EXISTS)
   
if self.op.mac_prefix: if self.op.mac_prefix:
utils.NormalizeAndValidateMac(self.op.mac_prefix+":00:00:00") utils.NormalizeAndValidateMac(self.op.mac_prefix + ":00:00:00")
   
# Check tag validity # Check tag validity
for tag in self.op.tags: for tag in self.op.tags:
objects.TaggableObject.ValidateTag(tag) objects.TaggableObject.ValidateTag(tag)
   
def BuildHooksEnv(self): def BuildHooksEnv(self):
"""Build hooks env. """Build hooks env.
   
...@@ -15681,7 +15682,6 @@ class LUNetworkRemove(LogicalUnit): ...@@ -15681,7 +15682,6 @@ class LUNetworkRemove(LogicalUnit):
locking.LEVEL_NETWORK: [self.network_uuid], locking.LEVEL_NETWORK: [self.network_uuid],
} }
   
def CheckPrereq(self): def CheckPrereq(self):
"""Check prerequisites. """Check prerequisites.
   
...@@ -15744,7 +15744,6 @@ class LUNetworkSetParams(LogicalUnit): ...@@ -15744,7 +15744,6 @@ class LUNetworkSetParams(LogicalUnit):
raise errors.OpPrereqError("Cannot modify gateway and reserved ips" raise errors.OpPrereqError("Cannot modify gateway and reserved ips"
" at once", errors.ECODE_INVAL) " at once", errors.ECODE_INVAL)
   
def ExpandNames(self): def ExpandNames(self):
self.network_uuid = self.cfg.LookupNetwork(self.op.network_name) self.network_uuid = self.cfg.LookupNetwork(self.op.network_name)
self.network = self.cfg.GetNetwork(self.network_uuid) self.network = self.cfg.GetNetwork(self.network_uuid)
...@@ -15788,7 +15787,7 @@ class LUNetworkSetParams(LogicalUnit): ...@@ -15788,7 +15787,7 @@ class LUNetworkSetParams(LogicalUnit):
if self.op.mac_prefix == constants.VALUE_NONE: if self.op.mac_prefix == constants.VALUE_NONE:
self.mac_prefix = None self.mac_prefix = None
else: else:
utils.NormalizeAndValidateMac(self.op.mac_prefix+":00:00:00") utils.NormalizeAndValidateMac(self.op.mac_prefix + ":00:00:00")
self.mac_prefix = self.op.mac_prefix self.mac_prefix = self.op.mac_prefix
   
if self.op.gateway6: if self.op.gateway6:
...@@ -15803,8 +15802,6 @@ class LUNetworkSetParams(LogicalUnit): ...@@ -15803,8 +15802,6 @@ class LUNetworkSetParams(LogicalUnit):
else: else:
self.network6 = self.op.network6 self.network6 = self.op.network6
   
def BuildHooksEnv(self): def BuildHooksEnv(self):
"""Build hooks env. """Build hooks env.
   
...@@ -15939,7 +15936,6 @@ class _NetworkQuery(_QueryBase): ...@@ -15939,7 +15936,6 @@ class _NetworkQuery(_QueryBase):
all_nodes = lu.cfg.GetAllNodesInfo() all_nodes = lu.cfg.GetAllNodesInfo()
network_to_instances = dict((uuid, []) for uuid in self.wanted) network_to_instances = dict((uuid, []) for uuid in self.wanted)
   
for group in all_groups.values(): for group in all_groups.values():
if do_instances: if do_instances:
group_nodes = [node.name for node in all_nodes.values() if group_nodes = [node.name for node in all_nodes.values() if
...@@ -15998,7 +15994,6 @@ class LUNetworkQuery(NoHooksLU): ...@@ -15998,7 +15994,6 @@ class LUNetworkQuery(NoHooksLU):
return self.nq.OldStyleQuery(self) return self.nq.OldStyleQuery(self)
   
   
class LUNetworkConnect(LogicalUnit): class LUNetworkConnect(LogicalUnit):
"""Connect a network to a nodegroup """Connect a network to a nodegroup
   
...@@ -16052,7 +16047,6 @@ class LUNetworkConnect(LogicalUnit): ...@@ -16052,7 +16047,6 @@ class LUNetworkConnect(LogicalUnit):
nodes = self.cfg.GetNodeGroup(self.group_uuid).members nodes = self.cfg.GetNodeGroup(self.group_uuid).members
return (nodes, nodes) return (nodes, nodes)
   
def CheckPrereq(self): def CheckPrereq(self):
l = lambda value: ", ".join("%s: %s/%s" % (i[0], i[1], i[2]) l = lambda value: ", ".join("%s: %s/%s" % (i[0], i[1], i[2])
for i in value) for i in value)
...@@ -16147,7 +16141,6 @@ class LUNetworkDisconnect(LogicalUnit): ...@@ -16147,7 +16141,6 @@ class LUNetworkDisconnect(LogicalUnit):
nodes = self.cfg.GetNodeGroup(self.group_uuid).members nodes = self.cfg.GetNodeGroup(self.group_uuid).members
return (nodes, nodes) return (nodes, nodes)
   
def CheckPrereq(self): def CheckPrereq(self):
l = lambda value: ", ".join("%s: %s/%s" % (i[0], i[1], i[2]) l = lambda value: ", ".join("%s: %s/%s" % (i[0], i[1], i[2])
for i in value) for i in value)
...@@ -16213,6 +16206,7 @@ def _GetQueryImplementation(name): ...@@ -16213,6 +16206,7 @@ def _GetQueryImplementation(name):
raise errors.OpPrereqError("Unknown query resource '%s'" % name, raise errors.OpPrereqError("Unknown query resource '%s'" % name,
errors.ECODE_INVAL) errors.ECODE_INVAL)
   
def _CheckForConflictingIp(lu, ip, node): def _CheckForConflictingIp(lu, ip, node):
"""In case of conflicting ip raise error. """In case of conflicting ip raise error.
   
......
...@@ -115,7 +115,6 @@ class TemporaryReservationManager: ...@@ -115,7 +115,6 @@ class TemporaryReservationManager:
ec_reserved.update(self._ec_reserved[ec_id]) ec_reserved.update(self._ec_reserved[ec_id])
return ec_reserved return ec_reserved
def Generate(self, existing, generate_one_fn, ec_id): def Generate(self, existing, generate_one_fn, ec_id):
"""Generate a new resource of this type """Generate a new resource of this type
...@@ -162,6 +161,7 @@ def _CheckInstanceDiskIvNames(disks): ...@@ -162,6 +161,7 @@ def _CheckInstanceDiskIvNames(disks):
return result return result
def _GenerateMACSuffix(): def _GenerateMACSuffix():
"""Generate one mac address """Generate one mac address
...@@ -241,7 +241,7 @@ class ConfigWriter: ...@@ -241,7 +241,7 @@ class ConfigWriter:
if nobj.mac_prefix: if nobj.mac_prefix:
prefix = nobj.mac_prefix prefix = nobj.mac_prefix
suffix = view_func(*args, **kwargs) suffix = view_func(*args, **kwargs)
return prefix+':'+suffix return prefix + ':' + suffix
return wraps(view_func)(_decorator) return wraps(view_func)(_decorator)
return _get_mac_prefix return _get_mac_prefix
...@@ -391,7 +391,6 @@ class ConfigWriter: ...@@ -391,7 +391,6 @@ class ConfigWriter:
return self._temporary_ips.Reserve(ec_id, ('reserve', address, net_uuid)) return self._temporary_ips.Reserve(ec_id, ('reserve', address, net_uuid))
@locking.ssynchronized(_config_lock, shared=1) @locking.ssynchronized(_config_lock, shared=1)
def ReserveIp(self, net, address, ec_id): def ReserveIp(self, net, address, ec_id):
"""Reserve a given IPv4 address for use by an instance. """Reserve a given IPv4 address for use by an instance.
...@@ -1444,7 +1443,6 @@ class ConfigWriter: ...@@ -1444,7 +1443,6 @@ class ConfigWriter:
# Return all IP addresses to the respective address pools # Return all IP addresses to the respective address pools
self._UnlockedCommitIp('release', net_uuid, nic.ip) self._UnlockedCommitIp('release', net_uuid, nic.ip)
del self._config_data.instances[instance_name] del self._config_data.instances[instance_name]
self._config_data.cluster.serial_no += 1 self._config_data.cluster.serial_no += 1
self._WriteConfig() self._WriteConfig()
...@@ -2546,7 +2544,6 @@ class ConfigWriter: ...@@ -2546,7 +2544,6 @@ class ConfigWriter:
""" """
return self._UnlockedGetGroupNetParams(net, node) return self._UnlockedGetGroupNetParams(net, node)
@locking.ssynchronized(_config_lock, shared=1) @locking.ssynchronized(_config_lock, shared=1)
def CheckIPInNodeGroup(self, ip, node): def CheckIPInNodeGroup(self, ip, node):
"""Check for conflictig IP. """Check for conflictig IP.
......
...@@ -334,7 +334,7 @@ VALID_STORAGE_FIELDS = frozenset([ ...@@ -334,7 +334,7 @@ VALID_STORAGE_FIELDS = frozenset([
SF_SIZE, SF_SIZE,
SF_USED, SF_USED,
SF_FREE, SF_FREE,
SF_ALLOCATABLE SF_ALLOCATABLE,
]) ])
VALID_STORAGE_TYPES = frozenset([ST_FILE, ST_LVM_PV, ST_LVM_VG]) VALID_STORAGE_TYPES = frozenset([ST_FILE, ST_LVM_PV, ST_LVM_VG])
...@@ -500,7 +500,7 @@ DISK_TEMPLATES = frozenset([ ...@@ -500,7 +500,7 @@ DISK_TEMPLATES = frozenset([
DT_FILE, DT_FILE,
DT_SHARED_FILE, DT_SHARED_FILE,
DT_BLOCK, DT_BLOCK,
DT_RBD DT_RBD,
]) ])
FILE_DRIVER = frozenset([FD_LOOP, FD_BLKTAP]) FILE_DRIVER = frozenset([FD_LOOP, FD_BLKTAP])
...@@ -613,7 +613,7 @@ OS_SCRIPTS = frozenset([ ...@@ -613,7 +613,7 @@ OS_SCRIPTS = frozenset([
OS_SCRIPT_IMPORT, OS_SCRIPT_IMPORT,
OS_SCRIPT_EXPORT, OS_SCRIPT_EXPORT,
OS_SCRIPT_RENAME, OS_SCRIPT_RENAME,
OS_SCRIPT_VERIFY OS_SCRIPT_VERIFY,
]) ])
OS_API_FILE = "ganeti_api_version" OS_API_FILE = "ganeti_api_version"
...@@ -635,7 +635,7 @@ INSTANCE_REBOOT_FULL = "full" ...@@ -635,7 +635,7 @@ INSTANCE_REBOOT_FULL = "full"
REBOOT_TYPES = frozenset([ REBOOT_TYPES = frozenset([
INSTANCE_REBOOT_SOFT, INSTANCE_REBOOT_SOFT,
INSTANCE_REBOOT_HARD, INSTANCE_REBOOT_HARD,
INSTANCE_REBOOT_FULL INSTANCE_REBOOT_FULL,
]) ])
# instance reboot behaviors # instance reboot behaviors
...@@ -644,7 +644,7 @@ INSTANCE_REBOOT_EXIT = "exit" ...@@ -644,7 +644,7 @@ INSTANCE_REBOOT_EXIT = "exit"
REBOOT_BEHAVIORS = frozenset([ REBOOT_BEHAVIORS = frozenset([
INSTANCE_REBOOT_ALLOWED, INSTANCE_REBOOT_ALLOWED,
INSTANCE_REBOOT_EXIT INSTANCE_REBOOT_EXIT,
]) ])
VTYPE_STRING = "string" VTYPE_STRING = "string"
...@@ -1039,7 +1039,7 @@ OOB_COMMANDS = frozenset([ ...@@ -1039,7 +1039,7 @@ OOB_COMMANDS = frozenset([
OOB_POWER_OFF, OOB_POWER_OFF,
OOB_POWER_CYCLE, OOB_POWER_CYCLE,
OOB_POWER_STATUS, OOB_POWER_STATUS,
OOB_HEALTH OOB_HEALTH,
]) ])
OOB_POWER_STATUS_POWERED = "powered" OOB_POWER_STATUS_POWERED = "powered"
...@@ -1152,7 +1152,7 @@ HT_HVM_VALID_NIC_TYPES = frozenset([ ...@@ -1152,7 +1152,7 @@ HT_HVM_VALID_NIC_TYPES = frozenset([
HT_NIC_NE2K_PCI, HT_NIC_NE2K_PCI,
HT_NIC_E1000, HT_NIC_E1000,
HT_NIC_NE2K_ISA, HT_NIC_NE2K_ISA,
HT_NIC_PARAVIRTUAL HT_NIC_PARAVIRTUAL,
]) ])
HT_KVM_VALID_NIC_TYPES = frozenset([ HT_KVM_VALID_NIC_TYPES = frozenset([
HT_NIC_RTL8139, HT_NIC_RTL8139,
...@@ -1163,7 +1163,7 @@ HT_KVM_VALID_NIC_TYPES = frozenset([ ...@@ -1163,7 +1163,7 @@ HT_KVM_VALID_NIC_TYPES = frozenset([
HT_NIC_I8259ER, HT_NIC_I8259ER,
HT_NIC_PCNET, HT_NIC_PCNET,
HT_NIC_E1000, HT_NIC_E1000,
HT_NIC_PARAVIRTUAL HT_NIC_PARAVIRTUAL,
]) ])
# Disk types # Disk types
...@@ -1182,7 +1182,7 @@ HT_VALID_CACHE_TYPES = frozenset([ ...@@ -1182,7 +1182,7 @@ HT_VALID_CACHE_TYPES = frozenset([
HT_CACHE_DEFAULT, HT_CACHE_DEFAULT,
HT_CACHE_NONE, HT_CACHE_NONE,
HT_CACHE_WTHROUGH, HT_CACHE_WTHROUGH,
HT_CACHE_WBACK HT_CACHE_WBACK,
]) ])
HT_HVM_VALID_DISK_TYPES = frozenset([HT_DISK_PARAVIRTUAL, HT_DISK_IOEMU]) HT_HVM_VALID_DISK_TYPES = frozenset([HT_DISK_PARAVIRTUAL, HT_DISK_IOEMU])
...@@ -1192,7 +1192,7 @@ HT_KVM_VALID_DISK_TYPES = frozenset([ ...@@ -1192,7 +1192,7 @@ HT_KVM_VALID_DISK_TYPES = frozenset([
HT_DISK_SCSI, HT_DISK_SCSI,
HT_DISK_SD, HT_DISK_SD,
HT_DISK_MTD, HT_DISK_MTD,
HT_DISK_PFLASH HT_DISK_PFLASH,
]) ])
# Mouse types: # Mouse types:
...@@ -1211,7 +1211,7 @@ HT_KVM_VALID_BO_TYPES = frozenset([ ...@@ -1211,7 +1211,7 @@ HT_KVM_VALID_BO_TYPES = frozenset([
HT_BO_FLOPPY, HT_BO_FLOPPY,
HT_BO_CDROM, HT_BO_CDROM,
HT_BO_DISK, HT_BO_DISK,
HT_BO_NETWORK HT_BO_NETWORK,
]) ])
# SPICE lossless image compression options # SPICE lossless image compression options
...@@ -1553,7 +1553,7 @@ OP_STATUS_ERROR = "error" ...@@ -1553,7 +1553,7 @@ OP_STATUS_ERROR = "error"
OPS_FINALIZED = frozenset([ OPS_FINALIZED = frozenset([
OP_STATUS_CANCELED, OP_STATUS_CANCELED,
OP_STATUS_SUCCESS, OP_STATUS_SUCCESS,
OP_STATUS_ERROR OP_STATUS_ERROR,
]) ])
# OpCode priority # OpCode priority
......
...@@ -494,7 +494,7 @@ class KVMHypervisor(hv_base.BaseHypervisor): ...@@ -494,7 +494,7 @@ class KVMHypervisor(hv_base.BaseHypervisor):
constants.HV_REBOOT_BEHAVIOR: constants.HV_REBOOT_BEHAVIOR:
hv_base.ParamInSet(True, constants.REBOOT_BEHAVIORS), hv_base.ParamInSet(True, constants.REBOOT_BEHAVIORS),
constants.HV_CPU_MASK: hv_base.OPT_MULTI_CPU_MASK_CHECK, constants.HV_CPU_MASK: hv_base.OPT_MULTI_CPU_MASK_CHECK,
constants.HV_CPU_TYPE: hv_base.NO_CHECK constants.HV_CPU_TYPE: hv_base.NO_CHECK,
} }
_MIGRATION_STATUS_RE = re.compile("Migration\s+status:\s+(\w+)", _MIGRATION_STATUS_RE = re.compile("Migration\s+status:\s+(\w+)",
...@@ -796,7 +796,6 @@ class KVMHypervisor(hv_base.BaseHypervisor): ...@@ -796,7 +796,6 @@ class KVMHypervisor(hv_base.BaseHypervisor):
return env return env
if nic.network: if nic.network:
n = objects.Network.FromDict(nic.netinfo) n = objects.Network.FromDict(nic.netinfo)
_BuildNetworkEnv(nic.network, n.network, n.gateway, _BuildNetworkEnv(nic.network, n.network, n.gateway,
......
...@@ -137,6 +137,7 @@ class XenHypervisor(hv_base.BaseHypervisor): ...@@ -137,6 +137,7 @@ class XenHypervisor(hv_base.BaseHypervisor):
# VM) to one physical CPU, using format 'cpu = "C"' # VM) to one physical CPU, using format 'cpu = "C"'
return "cpu = \"%s\"" % ",".join(map(str, all_cpu_mapping)) return "cpu = \"%s\"" % ",".join(map(str, all_cpu_mapping))
else: else:
def _GetCPUMap(vcpu): def _GetCPUMap(vcpu):
if vcpu[0] == constants.CPU_PINNING_ALL_VAL: if vcpu[0] == constants.CPU_PINNING_ALL_VAL: