Commit 016d04b3 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Even more style fixes


Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarLuca Bigliardi <shammash@google.com>
parent 1e37ad45
......@@ -493,19 +493,19 @@ class XenHvmHypervisor(XenHypervisor):
PARAMETERS = {
constants.HV_ACPI: hv_base.NO_CHECK,
constants.HV_BOOT_ORDER: (True, ) + \
(lambda x: x and len(x.strip("acdn")) == 0,
"Invalid boot order specified, must be one or more of [acdn]",
None, None),
constants.HV_BOOT_ORDER: (True, ) +
(lambda x: x and len(x.strip("acdn")) == 0,
"Invalid boot order specified, must be one or more of [acdn]",
None, None),
constants.HV_CDROM_IMAGE_PATH: hv_base.OPT_FILE_CHECK,
constants.HV_DISK_TYPE: \
hv_base.ParamInSet(True, constants.HT_HVM_VALID_DISK_TYPES),
constants.HV_NIC_TYPE: \
hv_base.ParamInSet(True, constants.HT_HVM_VALID_NIC_TYPES),
constants.HV_DISK_TYPE:
hv_base.ParamInSet(True, constants.HT_HVM_VALID_DISK_TYPES),
constants.HV_NIC_TYPE:
hv_base.ParamInSet(True, constants.HT_HVM_VALID_NIC_TYPES),
constants.HV_PAE: hv_base.NO_CHECK,
constants.HV_VNC_BIND_ADDRESS: \
(False, utils.IsValidIP,
"VNC bind address is not a valid IP address", None, None),
constants.HV_VNC_BIND_ADDRESS:
(False, utils.IsValidIP,
"VNC bind address is not a valid IP address", None, None),
constants.HV_KERNEL_PATH: hv_base.REQ_FILE_CHECK,
constants.HV_DEVICE_MODEL: hv_base.REQ_FILE_CHECK,
}
......
......@@ -285,8 +285,8 @@ class TaggableObject(ConfigObject):
class ConfigData(ConfigObject):
"""Top-level config object."""
__slots__ = ["version", "cluster", "nodes", "instances", "serial_no"] + \
_TIMESTAMPS
__slots__ = (["version", "cluster", "nodes", "instances", "serial_no"] +
_TIMESTAMPS)
def ToDict(self):
"""Custom function for top-level config data.
......@@ -828,12 +828,11 @@ class Cluster(TaggableObject):
# default_hypervisor is just the first enabled one in 2.1
if self.default_hypervisor is not None:
self.enabled_hypervisors = [self.default_hypervisor] + \
self.enabled_hypervisors = ([self.default_hypervisor] +
[hvname for hvname in self.enabled_hypervisors
if hvname != self.default_hypervisor]
if hvname != self.default_hypervisor])
self.default_hypervisor = None
def ToDict(self):
"""Custom function for cluster.
......
......@@ -1767,6 +1767,7 @@ def SetupLogging(logfile, debug=False, stderr_logging=False, program="",
# we need to re-raise the exception
raise
def IsNormAbsPath(path):
"""Check whether a path is absolute and also normalized
......@@ -1775,6 +1776,7 @@ def IsNormAbsPath(path):
"""
return os.path.normpath(path) == path and os.path.isabs(path)
def TailFile(fname, lines=20):
"""Return the last lines from a file.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment