Commit d0c8c01d authored by Iustin Pop's avatar Iustin Pop

Most boring patch ever

s/'/"/ in (hopefully) the right places.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 0fa044e7
This diff is collapsed.
......@@ -600,7 +600,7 @@ class LogicalVolume(BlockDev):
# one line for any non-empty string
logging.error("Can't parse LVS output, no lines? Got '%s'", str(out))
return False
out = out[-1].strip().rstrip(',')
out = out[-1].strip().rstrip(",")
out = out.split(",")
if len(out) != 5:
logging.error("Can't parse LVS output, len(%s) != 5", str(out))
......@@ -633,7 +633,7 @@ class LogicalVolume(BlockDev):
self.minor = minor
self.pe_size = pe_size
self.stripe_count = stripes
self._degraded = status[0] == 'v' # virtual volume, i.e. doesn't backing
self._degraded = status[0] == "v" # virtual volume, i.e. doesn't backing
# storage
self.attached = True
return True
......@@ -745,8 +745,8 @@ class LogicalVolume(BlockDev):
BlockDev.SetInfo(self, text)
# Replace invalid characters
text = re.sub('^[^A-Za-z0-9_+.]', '_', text)
text = re.sub('[^-A-Za-z0-9_+.]', '_', text)
text = re.sub("^[^A-Za-z0-9_+.]", "_", text)
text = re.sub("[^-A-Za-z0-9_+.]", "_", text)
# Only up to 128 characters are allowed
text = text[:128]
......@@ -971,14 +971,14 @@ class BaseDRBD(BlockDev): # pylint: disable-msg=W0223
first_line)
values = version.groups()
retval = {'k_major': int(values[0]),
'k_minor': int(values[1]),
'k_point': int(values[2]),
'api': int(values[3]),
'proto': int(values[4]),
retval = {"k_major": int(values[0]),
"k_minor": int(values[1]),
"k_point": int(values[2]),
"api": int(values[3]),
"proto": int(values[4]),
}
if values[5] is not None:
retval['proto2'] = values[5]
retval["proto2"] = values[5]
return retval
......@@ -1113,10 +1113,10 @@ class DRBD8(BaseDRBD):
super(DRBD8, self).__init__(unique_id, children, size)
self.major = self._DRBD_MAJOR
version = self._GetVersion(self._GetProcData())
if version['k_major'] != 8 :
if version["k_major"] != 8 :
_ThrowError("Mismatch in DRBD kernel version and requested ganeti"
" usage: kernel is %s.%s, ganeti wants 8.x",
version['k_major'], version['k_minor'])
version["k_major"], version["k_minor"])
if (self._lhost is not None and self._lhost == self._rhost and
self._lport == self._rport):
......@@ -1210,7 +1210,7 @@ class DRBD8(BaseDRBD):
pyp.Optional(pyp.restOfLine).suppress())
# an entire section
section_name = pyp.Word(pyp.alphas + '_')
section_name = pyp.Word(pyp.alphas + "_")
section = section_name + lbrace + pyp.ZeroOrMore(pyp.Group(stmt)) + rbrace
bnf = pyp.ZeroOrMore(pyp.Group(section ^ stmt))
......@@ -1343,18 +1343,18 @@ class DRBD8(BaseDRBD):
# what we aim here is to revert back to the 'drain' method of
# disk flushes and to disable metadata barriers, in effect going
# back to pre-8.0.7 behaviour
vmaj = version['k_major']
vmin = version['k_minor']
vrel = version['k_point']
vmaj = version["k_major"]
vmin = version["k_minor"]
vrel = version["k_point"]
assert vmaj == 8
if vmin == 0: # 8.0.x
if vrel >= 12:
args.extend(['-i', '-m'])
args.extend(["-i", "-m"])
elif vmin == 2: # 8.2.x
if vrel >= 7:
args.extend(['-i', '-m'])
args.extend(["-i", "-m"])
elif vmaj >= 3: # 8.3.x or newer
args.extend(['-i', '-a', 'm'])
args.extend(["-i", "-a", "m"])
result = utils.RunCmd(args)
if result.failed:
_ThrowError("drbd%d: can't attach local disk: %s", minor, result.output)
......@@ -2102,7 +2102,7 @@ class PersistentBlockDevice(BlockDev):
if not isinstance(unique_id, (tuple, list)) or len(unique_id) != 2:
raise ValueError("Invalid configuration data %s" % str(unique_id))
self.dev_path = unique_id[1]
if not os.path.realpath(self.dev_path).startswith('/dev/'):
if not os.path.realpath(self.dev_path).startswith("/dev/"):
raise ValueError("Full path '%s' lies outside /dev" %
os.path.realpath(self.dev_path))
# TODO: this is just a safety guard checking that we only deal with devices
......
......@@ -517,7 +517,7 @@ def check_ident_key_val(option, opt, value): # pylint: disable-msg=W0613
"""
if ":" not in value:
ident, rest = value, ''
ident, rest = value, ""
else:
ident, rest = value.split(":", 1)
......@@ -621,7 +621,7 @@ SEP_OPT = cli_option("--separator", default=None,
" (defaults to one space)"))
USEUNITS_OPT = cli_option("--units", default=None,
dest="units", choices=('h', 'm', 'g', 't'),
dest="units", choices=("h", "m", "g", "t"),
help="Specify units for output (one of h/m/g/t)")
FIELDS_OPT = cli_option("-o", "--output", dest="output", action="store",
......@@ -1417,8 +1417,8 @@ def SplitNodeOption(value):
"""Splits the value of a --node option.
"""
if value and ':' in value:
return value.split(':', 1)
if value and ":" in value:
return value.split(":", 1)
else:
return (value, None)
......@@ -1435,7 +1435,7 @@ def CalculateOSNames(os_name, os_variants):
"""
if os_variants:
return ['%s+%s' % (os_name, v) for v in os_variants]
return ["%s+%s" % (os_name, v) for v in os_variants]
else:
return [os_name]
......@@ -1477,12 +1477,12 @@ def AskUser(text, choices=None):
"""
if choices is None:
choices = [('y', True, 'Perform the operation'),
('n', False, 'Do not perform the operation')]
choices = [("y", True, "Perform the operation"),
("n", False, "Do not perform the operation")]
if not choices or not isinstance(choices, list):
raise errors.ProgrammerError("Invalid choices argument to AskUser")
for entry in choices:
if not isinstance(entry, tuple) or len(entry) < 3 or entry[0] == '?':
if not isinstance(entry, tuple) or len(entry) < 3 or entry[0] == "?":
raise errors.ProgrammerError("Invalid choices element to AskUser")
answer = choices[-1][1]
......@@ -1497,18 +1497,18 @@ def AskUser(text, choices=None):
try:
chars = [entry[0] for entry in choices]
chars[-1] = "[%s]" % chars[-1]
chars.append('?')
chars.append("?")
maps = dict([(entry[0], entry[1]) for entry in choices])
while True:
f.write(text)
f.write('\n')
f.write("\n")
f.write("/".join(chars))
f.write(": ")
line = f.readline(2).strip().lower()
if line in maps:
answer = maps[line]
break
elif line == '?':
elif line == "?":
for entry in choices:
f.write(" %s - %s\n" % (entry[0], entry[2]))
f.write("\n")
......@@ -1965,7 +1965,7 @@ def FormatError(err):
retcode = 0
else:
obuf.write("Unhandled exception: %s" % msg)
return retcode, obuf.getvalue().rstrip('\n')
return retcode, obuf.getvalue().rstrip("\n")
def GenericMain(commands, override=None, aliases=None):
......@@ -2381,7 +2381,7 @@ def GenerateTable(headers, fields, separator, data,
if separator is None:
mlens = [0 for name in fields]
format_str = ' '.join(format_fields)
format_str = " ".join(format_fields)
else:
format_str = separator.replace("%", "%%").join(format_fields)
......@@ -2420,7 +2420,7 @@ def GenerateTable(headers, fields, separator, data,
for line in data:
args = []
if line is None:
line = ['-' for _ in fields]
line = ["-" for _ in fields]
for idx in range(len(fields)):
if separator is None:
args.append(mlens[idx])
......@@ -2826,7 +2826,7 @@ def FormatTimestamp(ts):
"""
if not isinstance (ts, (tuple, list)) or len(ts) != 2:
return '?'
return "?"
sec, usec = ts
return time.strftime("%F %T", time.localtime(sec)) + ".%06d" % usec
......@@ -2849,11 +2849,11 @@ def ParseTimespec(value):
if not value:
raise errors.OpPrereqError("Empty time specification passed")
suffix_map = {
's': 1,
'm': 60,
'h': 3600,
'd': 86400,
'w': 604800,
"s": 1,
"m": 60,
"h": 3600,
"d": 86400,
"w": 604800,
}
if value[-1] not in suffix_map:
try:
......@@ -2966,7 +2966,7 @@ def _ToStream(stream, txt, *args):
stream.write(txt % args)
else:
stream.write(txt)
stream.write('\n')
stream.write("\n")
stream.flush()
except IOError, err:
if err.errno == errno.EPIPE:
......
......@@ -1242,7 +1242,7 @@ def Epo(opts, args):
commands = {
'init': (
"init": (
InitCluster, [ArgHost(min=1, max=1)],
[BACKEND_OPT, CP_SIZE_OPT, ENABLED_HV_OPT, GLOBAL_FILEDIR_OPT,
HVLIST_OPT, MAC_PREFIX_OPT, MASTER_NETDEV_OPT, NIC_PARAMS_OPT,
......@@ -1252,75 +1252,75 @@ commands = {
DEFAULT_IALLOCATOR_OPT, PRIMARY_IP_VERSION_OPT, PREALLOC_WIPE_DISKS_OPT,
NODE_PARAMS_OPT, GLOBAL_SHARED_FILEDIR_OPT],
"[opts...] <cluster_name>", "Initialises a new cluster configuration"),
'destroy': (
"destroy": (
DestroyCluster, ARGS_NONE, [YES_DOIT_OPT],
"", "Destroy cluster"),
'rename': (
"rename": (
RenameCluster, [ArgHost(min=1, max=1)],
[FORCE_OPT, DRY_RUN_OPT],
"<new_name>",
"Renames the cluster"),
'redist-conf': (
"redist-conf": (
RedistributeConfig, ARGS_NONE, [SUBMIT_OPT, DRY_RUN_OPT, PRIORITY_OPT],
"", "Forces a push of the configuration file and ssconf files"
" to the nodes in the cluster"),
'verify': (
"verify": (
VerifyCluster, ARGS_NONE,
[VERBOSE_OPT, DEBUG_SIMERR_OPT, ERROR_CODES_OPT, NONPLUS1_OPT,
DRY_RUN_OPT, PRIORITY_OPT, NODEGROUP_OPT],
"", "Does a check on the cluster configuration"),
'verify-disks': (
"verify-disks": (
VerifyDisks, ARGS_NONE, [PRIORITY_OPT],
"", "Does a check on the cluster disk status"),
'repair-disk-sizes': (
"repair-disk-sizes": (
RepairDiskSizes, ARGS_MANY_INSTANCES, [DRY_RUN_OPT, PRIORITY_OPT],
"", "Updates mismatches in recorded disk sizes"),
'master-failover': (
"master-failover": (
MasterFailover, ARGS_NONE, [NOVOTING_OPT],
"", "Makes the current node the master"),
'master-ping': (
"master-ping": (
MasterPing, ARGS_NONE, [],
"", "Checks if the master is alive"),
'version': (
"version": (
ShowClusterVersion, ARGS_NONE, [],
"", "Shows the cluster version"),
'getmaster': (
"getmaster": (
ShowClusterMaster, ARGS_NONE, [],
"", "Shows the cluster master"),
'copyfile': (
"copyfile": (
ClusterCopyFile, [ArgFile(min=1, max=1)],
[NODE_LIST_OPT, USE_REPL_NET_OPT, NODEGROUP_OPT],
"[-n node...] <filename>", "Copies a file to all (or only some) nodes"),
'command': (
"command": (
RunClusterCommand, [ArgCommand(min=1)],
[NODE_LIST_OPT, NODEGROUP_OPT],
"[-n node...] <command>", "Runs a command on all (or only some) nodes"),
'info': (
"info": (
ShowClusterConfig, ARGS_NONE, [ROMAN_OPT],
"[--roman]", "Show cluster configuration"),
'list-tags': (
"list-tags": (
ListTags, ARGS_NONE, [], "", "List the tags of the cluster"),
'add-tags': (
"add-tags": (
AddTags, [ArgUnknown()], [TAG_SRC_OPT, PRIORITY_OPT],
"tag...", "Add tags to the cluster"),
'remove-tags': (
"remove-tags": (
RemoveTags, [ArgUnknown()], [TAG_SRC_OPT, PRIORITY_OPT],
"tag...", "Remove tags from the cluster"),
'search-tags': (
"search-tags": (
SearchTags, [ArgUnknown(min=1, max=1)], [PRIORITY_OPT], "",
"Searches the tags on all objects on"
" the cluster for a given pattern (regex)"),
'queue': (
"queue": (
QueueOps,
[ArgChoice(min=1, max=1, choices=["drain", "undrain", "info"])],
[], "drain|undrain|info", "Change queue properties"),
'watcher': (
"watcher": (
WatcherOps,
[ArgChoice(min=1, max=1, choices=["pause", "continue", "info"]),
ArgSuggest(min=0, max=1, choices=["30m", "1h", "4h"])],
[],
"{pause <timespec>|continue|info}", "Change watcher properties"),
'modify': (
"modify": (
SetClusterParams, ARGS_NONE,
[BACKEND_OPT, CP_SIZE_OPT, ENABLED_HV_OPT, HVLIST_OPT, MASTER_NETDEV_OPT,
NIC_PARAMS_OPT, NOLVM_STORAGE_OPT, VG_NAME_OPT, MAINTAIN_NODE_HEALTH_OPT,
......@@ -1347,7 +1347,7 @@ commands = {
#: dictionary with aliases for commands
aliases = {
'masterfailover': 'master-failover',
"masterfailover": "master-failover",
}
......
......@@ -143,7 +143,7 @@ def TestAllocator(opts, args):
while len(row) < 3:
row.append(None)
for i in range(3):
if row[i] == '':
if row[i] == "":
row[i] = None
nic_dict = [{
constants.INIC_MAC: v[0],
......@@ -616,7 +616,7 @@ def ListLocks(opts, args): # pylint: disable-msg=W0613
commands = {
'delay': (
"delay": (
Delay, [ArgUnknown(min=1, max=1)],
[cli_option("--no-master", dest="on_master", default=True,
action="store_false", help="Do not sleep in the master code"),
......@@ -627,7 +627,7 @@ commands = {
DRY_RUN_OPT, PRIORITY_OPT,
],
"[opts...] <duration>", "Executes a TestDelay OpCode"),
'submit-job': (
"submit-job": (
GenericOpCodes, [ArgFile(min=1)],
[VERBOSE_OPT,
cli_option("--op-repeat", type="int", default="1", dest="rep_op",
......@@ -642,7 +642,7 @@ commands = {
],
"<op_list_file...>", "Submits jobs built from json files"
" containing a list of serialized opcodes"),
'iallocator': (
"iallocator": (
TestAllocator, [ArgUnknown(min=1)],
[cli_option("--dir", dest="direction", default=constants.IALLOCATOR_DIR_IN,
choices=list(constants.VALID_IALLOCATOR_DIRECTIONS),
......
This diff is collapsed.
......@@ -157,7 +157,7 @@ def AutoArchiveJobs(opts, args):
age = args[0]
if age == 'all':
if age == "all":
age = -1
else:
age = ParseTimespec(age)
......@@ -357,7 +357,7 @@ def WatchJob(opts, args):
commands = {
'list': (
"list": (
ListJobs, [ArgJobId()],
[NOHDR_OPT, SEP_OPT, FIELDS_OPT],
"[job_id ...]",
......@@ -366,22 +366,22 @@ commands = {
" op_status, op_result."
" The default field"
" list is (in order): %s." % utils.CommaJoin(_LIST_DEF_FIELDS)),
'archive': (
"archive": (
ArchiveJobs, [ArgJobId(min=1)], [],
"<job-id> [<job-id> ...]", "Archive specified jobs"),
'autoarchive': (
"autoarchive": (
AutoArchiveJobs,
[ArgSuggest(min=1, max=1, choices=["1d", "1w", "4w", "all"])],
[],
"<age>", "Auto archive jobs older than the given age"),
'cancel': (
"cancel": (
CancelJobs, [ArgJobId(min=1)], [],
"<job-id> [<job-id> ...]", "Cancel specified jobs"),
'info': (
"info": (
ShowJobs, [ArgJobId(min=1)], [],
"<job-id> [<job-id> ...]",
"Show detailed information about the specified jobs"),
'watch': (
"watch": (
WatchJob, [ArgJobId(min=1, max=1)], [],
"<job-id>", "Follows a job and prints its output as it arrives"),
}
......
......@@ -174,7 +174,7 @@ def AddNode(opts, args):
readd = opts.readd
try:
output = cl.QueryNodes(names=[node], fields=['name', 'sip', 'master'],
output = cl.QueryNodes(names=[node], fields=["name", "sip", "master"],
use_locking=False)
node_exists, sip, is_master = output[0]
except (errors.OpPrereqError, errors.OpExecError):
......@@ -197,7 +197,7 @@ def AddNode(opts, args):
sip = opts.secondary_ip
# read the cluster name from the master
output = cl.QueryConfigValues(['cluster_name'])
output = cl.QueryConfigValues(["cluster_name"])
cluster_name = output[0]
if not readd and opts.node_setup:
......@@ -851,7 +851,7 @@ def SetNodeParams(opts, args):
commands = {
'add': (
"add": (
AddNode, [ArgHost(min=1, max=1)],
[SECONDARY_IP_OPT, READD_OPT, NOSSH_KEYCHECK_OPT, NODE_FORCE_JOIN_OPT,
NONODE_SETUP_OPT, VERBOSE_OPT, NODEGROUP_OPT, PRIORITY_OPT,
......@@ -867,23 +867,23 @@ commands = {
"[-f] {-I <iallocator> | -n <dst>} <node>",
"Relocate the secondary instances from a node"
" to other nodes"),
'failover': (
"failover": (
FailoverNode, ARGS_ONE_NODE, [FORCE_OPT, IGNORE_CONSIST_OPT,
IALLOCATOR_OPT, PRIORITY_OPT],
"[-f] <node>",
"Stops the primary instances on a node and start them on their"
" secondary node (only for instances with drbd disk template)"),
'migrate': (
"migrate": (
MigrateNode, ARGS_ONE_NODE,
[FORCE_OPT, NONLIVE_OPT, MIGRATION_MODE_OPT, DST_NODE_OPT,
IALLOCATOR_OPT, PRIORITY_OPT],
"[-f] <node>",
"Migrate all the primary instance on a node away from it"
" (only for instances of type drbd)"),
'info': (
"info": (
ShowNodeConfig, ARGS_MANY_NODES, [],
"[<node_name>...]", "Show information about the node(s)"),
'list': (
"list": (
ListNodes, ARGS_MANY_NODES,
[NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT, VERBOSE_OPT,
FORCE_FILTER_OPT],
......@@ -897,18 +897,18 @@ commands = {
[NOHDR_OPT, SEP_OPT],
"[fields...]",
"Lists all available fields for nodes"),
'modify': (
"modify": (
SetNodeParams, ARGS_ONE_NODE,
[FORCE_OPT, SUBMIT_OPT, MC_OPT, DRAINED_OPT, OFFLINE_OPT,
CAPAB_MASTER_OPT, CAPAB_VM_OPT, SECONDARY_IP_OPT,
AUTO_PROMOTE_OPT, DRY_RUN_OPT, PRIORITY_OPT, NODE_PARAMS_OPT,
NODE_POWERED_OPT],
"<node_name>", "Alters the parameters of a node"),
'powercycle': (
"powercycle": (
PowercycleNode, ARGS_ONE_NODE,
[FORCE_OPT, CONFIRM_OPT, DRY_RUN_OPT, PRIORITY_OPT],
"<node_name>", "Tries to forcefully powercycle a node"),
'power': (
"power": (
PowerNode,
[ArgChoice(min=1, max=1, choices=_LIST_POWER_COMMANDS),
ArgNode()],
......@@ -916,28 +916,28 @@ commands = {
FORCE_OPT, NOHDR_OPT, SEP_OPT, OOB_TIMEOUT_OPT, POWER_DELAY_OPT],
"on|off|cycle|status [nodes...]",
"Change power state of node by calling out-of-band helper."),
'remove': (
"remove": (
RemoveNode, ARGS_ONE_NODE, [DRY_RUN_OPT, PRIORITY_OPT],
"<node_name>", "Removes a node from the cluster"),
'volumes': (
"volumes": (
ListVolumes, [ArgNode()],
[NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT, PRIORITY_OPT],
"[<node_name>...]", "List logical volumes on node(s)"),
'list-storage': (
"list-storage": (
ListStorage, ARGS_MANY_NODES,
[NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT, _STORAGE_TYPE_OPT,
PRIORITY_OPT],
"[<node_name>...]", "List physical volumes on node(s). The available"
" fields are (see the man page for details): %s." %
(utils.CommaJoin(_LIST_STOR_HEADERS))),
'modify-storage': (
"modify-storage": (
ModifyStorage,
[ArgNode(min=1, max=1),
ArgChoice(min=1, max=1, choices=_MODIFIABLE_STORAGE_TYPES),
ArgFile(min=1, max=1)],
[ALLOCATABLE_OPT, DRY_RUN_OPT, PRIORITY_OPT],
"<node_name> <storage_type> <name>", "Modify storage volume on a node"),
'repair-storage': (
"repair-storage": (
RepairStorage,
[ArgNode(min=1, max=1),
ArgChoice(min=1, max=1, choices=_REPAIRABLE_STORAGE_TYPES),
......@@ -945,13 +945,13 @@ commands = {
[IGNORE_CONSIST_OPT, DRY_RUN_OPT, PRIORITY_OPT],
"<node_name> <storage_type> <name>",
"Repairs a storage volume on a node"),
'list-tags': (
"list-tags": (
ListTags, ARGS_ONE_NODE, [],
"<node_name>", "List the tags of the given node"),
'add-tags': (
"add-tags": (
AddTags, [ArgNode(min=1, max=1), ArgUnknown()], [TAG_SRC_OPT, PRIORITY_OPT],
"<node_name> tag...", "Add tags to the given node"),
'remove-tags': (
"remove-tags": (
RemoveTags, [ArgNode(min=1, max=1), ArgUnknown()],
[TAG_SRC_OPT, PRIORITY_OPT],
"<node_name> tag...", "Remove tags from the given node"),
......
......@@ -280,17 +280,17 @@ def ModifyOS(opts, args):
commands = {
'list': (
"list": (
ListOS, ARGS_NONE, [NOHDR_OPT, PRIORITY_OPT],
"", "Lists all valid operating systems on the cluster"),
'diagnose': (
"diagnose": (
DiagnoseOS, ARGS_NONE, [PRIORITY_OPT],
"", "Diagnose all operating systems"),
'info': (
"info": (
ShowOSInfo, [ArgOs()], [PRIORITY_OPT],
"", "Show detailed information about "
"operating systems"),
'modify': (
"modify": (
ModifyOS, ARGS_ONE_OS,
[HVLIST_OPT, OSPARAMS_OPT, DRY_RUN_OPT, PRIORITY_OPT,
HID_OS_OPT, BLK_OS_OPT],
......
This diff is collapsed.
......@@ -210,7 +210,7 @@ PROC_MOUNTS = "/proc/mounts"
LUXI_EOM = "\3"
LUXI_VERSION = CONFIG_VERSION
# one of 'no', 'yes', 'only'
# one of "no", "yes", "only"
SYSLOG_USAGE = _autoconf.SYSLOG_USAGE
SYSLOG_NO = "no"
SYSLOG_YES = "yes"
......@@ -438,8 +438,8 @@ EXPORT_MODES = frozenset([
])
# Lock recalculate mode
LOCKS_REPLACE = 'replace'
LOCKS_APPEND = 'append'
LOCKS_REPLACE = "replace"
LOCKS_APPEND = "append"
# Lock timeout (sum) before we should go into blocking acquire (still
# can be reset by priority change); computed as max time (10 hours)
......@@ -559,20 +559,20 @@ RUNPARTS_STATUS = frozenset([RUNPARTS_SKIP, RUNPARTS_RUN, RUNPARTS_ERR])
RPC_ENCODING_ZLIB_BASE64) = range(2)
# os related constants
OS_SCRIPT_CREATE = 'create'
OS_SCRIPT_IMPORT = 'import'
OS_SCRIPT_EXPORT = 'export'
OS_SCRIPT_RENAME = 'rename'
OS_SCRIPT_VERIFY = 'verify'
OS_SCRIPT_CREATE = "create"
OS_SCRIPT_IMPORT = "import"
OS_SCRIPT_EXPORT = "export"
OS_SCRIPT_RENAME = "rename"
OS_SCRIPT_VERIFY = "verify"
OS_SCRIPTS = frozenset([OS_SCRIPT_CREATE, OS_SCRIPT_IMPORT,
OS_SCRIPT_EXPORT, OS_SCRIPT_RENAME,
OS_SCRIPT_VERIFY])
OS_API_FILE = 'ganeti_api_version'
OS_VARIANTS_FILE = 'variants.list'
OS_PARAMETERS_FILE = 'parameters.list'
OS_API_FILE = "ganeti_api_version"
OS_VARIANTS_FILE = "variants.list"
OS_PARAMETERS_FILE = "parameters.list"
OS_VALIDATE_PARAMETERS = 'parameters'
OS_VALIDATE_PARAMETERS = "parameters"
OS_VALIDATE_CALLS = frozenset([OS_VALIDATE_PARAMETERS])
# ssh constants
......@@ -593,11 +593,11 @@ REBOOT_TYPES = frozenset([INSTANCE_REBOOT_SOFT,
INSTANCE_REBOOT_HARD,
INSTANCE_REBOOT_FULL])
VTYPE_STRING = 'string'
VTYPE_STRING = "string"
VTYPE_MAYBE_STRING = "maybe-string"
VTYPE_BOOL = 'bool'
VTYPE_SIZE = 'size' # size, in MiBs
VTYPE_INT = 'int'
VTYPE_BOOL = "bool"
VTYPE_SIZE = "size" # size, in MiBs
VTYPE_INT = "int"
ENFORCEABLE_TYPES = frozenset([
VTYPE_STRING,
VTYPE_MAYBE_STRING,
......@@ -885,7 +885,7 @@ HT_MIGRATION_NONLIVE = "non-live"
HT_MIGRATION_MODES = frozenset([HT_MIGRATION_LIVE, HT_MIGRATION_NONLIVE])
# Cluster Verify steps
VERIFY_NPLUSONE_MEM = 'nplusone_mem'
VERIFY_NPLUSONE_MEM = "nplusone_mem"
VERIFY_OPTIONAL_CHECKS = frozenset([VERIFY_NPLUSONE_MEM])
# Node verify constants
......@@ -1169,18 +1169,18 @@ HVC_DEFAULTS = {
HT_XEN_PVM: {
HV_USE_BOOTLOADER: False,
HV_BOOTLOADER_PATH: XEN_BOOTLOADER,
HV_BOOTLOADER_ARGS: '',
HV_BOOTLOADER_ARGS: "",
HV_KERNEL_PATH: "/boot/vmlinuz-2.6-xenU",
HV_INITRD_PATH: '',
HV_ROOT_PATH: '/dev/sda1',
HV_KERNEL_ARGS: 'ro',
HV_INITRD_PATH: "",
HV_ROOT_PATH: "/dev/sda1",
HV_KERNEL_ARGS: "ro",
HV_MIGRATION_PORT: 8002,
HV_MIGRATION_MODE: HT_MIGRATION_LIVE,
HV_BLOCKDEV_PREFIX: "sd",
},
HT_XEN_HVM: {
HV_BOOT_ORDER: "cd",
HV_CDROM_IMAGE_PATH: '',
HV_CDROM_IMAGE_PATH: "",
HV_NIC_TYPE: HT_NIC_RTL8139,
HV_DISK_TYPE: HT_DISK_PARAVIRTUAL,
HV_VNC_BIND_ADDRESS: IP4_ADDRESS_ANY,
......@@ -1196,24 +1196,24 @@ HVC_DEFAULTS = {
},
HT_KVM: {
HV_KERNEL_PATH: "/boot/vmlinuz-2.6-kvmU",
HV_INITRD_PATH: '',
HV_KERNEL_ARGS: 'ro',
HV_ROOT_PATH: '/dev/vda1',
HV_INITRD_PATH: "",
HV_KERNEL_ARGS: "ro",
HV_ROOT_PATH: "/dev/vda1",
HV_ACPI: True,
HV_SERIAL_CONSOLE: True,
HV_VNC_BIND_ADDRESS: '',
HV_VNC_BIND_ADDRESS: "",
HV_VNC_TLS: False,
HV_VNC_X509: '',
HV_VNC_X509: "",
HV_VNC_X509_VERIFY: False,
HV_VNC_PASSWORD_FILE: '',
HV_KVM_FLOPPY_IMAGE_PATH: '',
HV_CDROM_IMAGE_PATH: '',
HV_KVM_CDROM2_IMAGE_PATH: '',
HV_VNC_PASSWORD_FILE: "",
HV_KVM_FLOPPY_IMAGE_PATH: "",
HV_CDROM_IMAGE_PATH: "",
HV_KVM_CDROM2_IMAGE_PATH: "",
HV_BOOT_ORDER: HT_BO_DISK,
HV_NIC_TYPE: HT_NIC_PARAVIRTUAL,
HV_DISK_TYPE: HT_DISK_PARAVIRTUAL,