Commit 8913ab40 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Merge branch 'devel-2.5'



* devel-2.5: (32 commits)
  PEP8 style fixes
  Wrap a few long lines
  listrunner: Avoid exception if machine is rebooted
  Remove wrong type declaration from option
  Fix wrong method name in cluster-merge
  Fix --skip-stop-instances help message
  cluster-merge: Add the --skip-stop-instances opt
  watcher: Wait for child processes by default
  Update release date in NEWS for 2.5.0~beta2
  Try 3 times before giving up on per-node commands
  Allow retrying commands in cluster-merge
  Add a TODO on the VerifyCluster option
  Transform node readd exceptions into just errors
  Offline node when adding it to a merged cluster
  Bump version to 2.5.0~beta2
  sphinx_ext: workaround epydoc warning
  check-news: Show per-file line number
  Unify some file headers
  Makefile: Add design-ovf-support to list of doc files
  ensure-dirs: Fix epydoc error
  ...
Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
parents a7f884d3 e687ec01
......@@ -294,6 +294,7 @@ docrst = \
doc/design-multi-reloc.rst \
doc/design-network.rst \
doc/design-chained-jobs.rst \
doc/design-ovf-support.rst \
doc/cluster-merge.rst \
doc/design-shared-storage.rst \
doc/devnotes.rst \
......
News
====
Version 2.5.0 beta1
Version 2.5.0 beta2
-------------------
*(Released Fri, 12 Aug 2011)*
*(Released Mon, 22 Aug 2011)*
Incompatible/important changes and bugfixes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......@@ -84,6 +84,7 @@ New features
- ``gnt-instance info`` defaults to static information if primary node
is offline.
- Opcodes have a new ``comment`` attribute.
- Added basic SPICE support to KVM hypervisor.
Node group improvements
~~~~~~~~~~~~~~~~~~~~~~~
......@@ -127,6 +128,14 @@ Misc
- DRBD metadata volumes are overwritten with zeros during disk creation.
Version 2.5.0 beta1
-------------------
*(Released Fri, 12 Aug 2011)*
This was the first beta release of the 2.5 series.
Version 2.4.3
-------------
......
......@@ -51,7 +51,7 @@ def main():
if DASHES_RE.match(line):
if not prevline.startswith("Version "):
raise Exception("Line %s: Invalid title" % (fileinput.lineno() - 1))
raise Exception("Line %s: Invalid title" % (fileinput.filelineno() - 1))
expect_date = True
elif expect_date:
......@@ -66,7 +66,8 @@ def main():
m = RELEASED_RE.match(line)
if not m:
raise Exception("Line %s: Invalid release line" % fileinput.lineno())
raise Exception("Line %s: Invalid release line" %
fileinput.filelineno())
# Including the weekday in the date string does not work as time.strptime
# would return an inconsistent result if the weekday is incorrect.
......@@ -77,7 +78,8 @@ def main():
# Check weekday
if m.group("day") != weekday:
raise Exception("Line %s: %s was/is a %s, not %s" %
(fileinput.lineno(), parsed, weekday, m.group("day")))
(fileinput.filelineno(), parsed, weekday,
m.group("day")))
expect_date = False
......
......@@ -2,7 +2,7 @@
m4_define([gnt_version_major], [2])
m4_define([gnt_version_minor], [5])
m4_define([gnt_version_revision], [0])
m4_define([gnt_version_suffix], [~beta1])
m4_define([gnt_version_suffix], [~beta2])
m4_define([gnt_version_full],
m4_format([%d.%d.%d%s],
gnt_version_major, gnt_version_minor,
......
......@@ -128,7 +128,7 @@ class StatusFile:
@param port: TCP/UDP port
"""
assert isinstance(port, (int, long)) and 0 < port < 2**16
assert isinstance(port, (int, long)) and 0 < port < (2 ** 16)
self._data.listen_port = port
def GetListenPort(self):
......
......@@ -34,6 +34,7 @@ except ImportError:
from ganeti import daemon
from ganeti import errors
# We contributed the AsyncNotifier class back to python-pyinotify, and it's
# part of their codebase since version 0.8.7. This code can be removed once
# we'll be ready to depend on python-pyinotify >= 0.8.7
......
......@@ -730,7 +730,7 @@ def GetVolumeList(vg_names):
# we don't want to report such volumes as existing, since they
# don't really hold data
continue
lvs[vg_name+"/"+name] = (size, inactive, online)
lvs[vg_name + "/" + name] = (size, inactive, online)
return lvs
......@@ -2359,7 +2359,7 @@ def FinalizeExport(instance, snap_disks):
config.set(constants.INISECT_INS, "nic%d_%s" % (nic_count, param),
"%s" % nic.nicparams.get(param, None))
# TODO: redundant: on load can read nics until it doesn't exist
config.set(constants.INISECT_INS, "nic_count" , "%d" % nic_total)
config.set(constants.INISECT_INS, "nic_count", "%d" % nic_total)
disk_total = 0
for disk_count, disk in enumerate(snap_disks):
......@@ -2372,7 +2372,7 @@ def FinalizeExport(instance, snap_disks):
config.set(constants.INISECT_INS, "disk%d_size" % disk_count,
("%d" % disk.size))
config.set(constants.INISECT_INS, "disk_count" , "%d" % disk_total)
config.set(constants.INISECT_INS, "disk_count", "%d" % disk_total)
# New-style hypervisor/backend parameters
......@@ -3378,7 +3378,6 @@ class HooksRunner(object):
else:
_Fail("Unknown hooks phase '%s'", phase)
subdir = "%s-%s.d" % (hpath, suffix)
dir_name = utils.PathJoin(self._BASE_DIR, subdir)
......
......@@ -321,7 +321,6 @@ class BlockDev(object):
is_degraded=is_degraded,
ldisk_status=ldisk_status)
def SetInfo(self, text):
"""Update metadata with info text.
......@@ -408,12 +407,12 @@ class LogicalVolume(BlockDev):
pvs_info.sort()
pvs_info.reverse()
pvlist = [ pv[1] for pv in pvs_info ]
pvlist = [pv[1] for pv in pvs_info]
if compat.any(":" in v for v in pvlist):
_ThrowError("Some of your PVs have the invalid character ':' in their"
" name, this is not supported - please filter them out"
" in lvm.conf using either 'filter' or 'preferred_names'")
free_size = sum([ pv[0] for pv in pvs_info ])
free_size = sum([pv[0] for pv in pvs_info])
current_pvs = len(pvlist)
stripes = min(current_pvs, constants.LVM_STRIPECOUNT)
......@@ -1113,7 +1112,7 @@ 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"])
......@@ -1194,7 +1193,7 @@ class DRBD8(BaseDRBD):
# this also converts the value to an int
number = pyp.Word(pyp.nums).setParseAction(lambda s, l, t: int(t[0]))
comment = pyp.Literal ("#") + pyp.Optional(pyp.restOfLine)
comment = pyp.Literal("#") + pyp.Optional(pyp.restOfLine)
defa = pyp.Literal("_is_default").suppress()
dbl_quote = pyp.Literal('"').suppress()
......
......@@ -270,7 +270,6 @@ def InitCluster(cluster_name, mac_prefix, # pylint: disable-msg=R0913
" entries: %s" % invalid_hvs,
errors.ECODE_INVAL)
ipcls = None
if primary_ip_version == constants.IP4_VERSION:
ipcls = netutils.IP4Address
......@@ -661,6 +660,7 @@ def MasterFailover(no_voting=False):
master_ip = sstore.GetMasterIP()
total_timeout = 30
# Here we have a phase where no master should be running
def _check_ip():
if netutils.TcpPing(master_ip, constants.DEFAULT_NODED_PORT):
......
......@@ -32,6 +32,8 @@ import docutils.utils
import sphinx.errors
import sphinx.util.compat
s_compat = sphinx.util.compat
from ganeti import constants
from ganeti import compat
from ganeti import errors
......@@ -147,7 +149,7 @@ def _BuildOpcodeResult(op_id):
return "``%s``" % result_fn
class OpcodeParams(sphinx.util.compat.Directive):
class OpcodeParams(s_compat.Directive):
"""Custom directive for opcode parameters.
See also <http://docutils.sourceforge.net/docs/howto/rst-directives.html>.
......@@ -178,7 +180,7 @@ class OpcodeParams(sphinx.util.compat.Directive):
return []
class OpcodeResult(sphinx.util.compat.Directive):
class OpcodeResult(s_compat.Directive):
"""Custom directive for opcode result.
See also <http://docutils.sourceforge.net/docs/howto/rst-directives.html>.
......@@ -230,7 +232,7 @@ def PythonEvalRole(role, rawtext, text, lineno, inliner,
return ([node], [])
class PythonAssert(sphinx.util.compat.Directive):
class PythonAssert(s_compat.Directive):
"""Custom directive for writing assertions.
The content must be a valid Python expression. If its result does not
......
......@@ -728,9 +728,9 @@ BACKEND_OPT = cli_option("-B", "--backend-parameters", dest="beparams",
type="keyval", default={},
help="Backend parameters")
HVOPTS_OPT = cli_option("-H", "--hypervisor-parameters", type="keyval",
default={}, dest="hvparams",
help="Hypervisor parameters")
HVOPTS_OPT = cli_option("-H", "--hypervisor-parameters", type="keyval",
default={}, dest="hvparams",
help="Hypervisor parameters")
HYPERVISOR_OPT = cli_option("-H", "--hypervisor-parameters", dest="hypervisor",
help="Hypervisor and hypervisor options, in the"
......@@ -2815,7 +2815,7 @@ def FormatTimestamp(ts):
@return: a string with the formatted timestamp
"""
if not isinstance (ts, (tuple, list)) or len(ts) != 2:
if not isinstance(ts, (tuple, list)) or len(ts) != 2:
return "?"
sec, usec = ts
return time.strftime("%F %T", time.localtime(sec)) + ".%06d" % usec
......
......@@ -113,9 +113,9 @@ def GenericOpCodes(opts, args):
t3 = time.time()
ToStdout("C:op %4d" % op_cnt)
ToStdout("C:job %4d" % job_cnt)
ToStdout("T:submit %4.4f" % (t2-t1))
ToStdout("T:exec %4.4f" % (t3-t2))
ToStdout("T:total %4.4f" % (t3-t1))
ToStdout("T:submit %4.4f" % (t2 - t1))
ToStdout("T:exec %4.4f" % (t3 - t2))
ToStdout("T:total %4.4f" % (t3 - t1))
return 0
......@@ -689,5 +689,6 @@ aliases = {
"allocator": "iallocator",
}
def Main():
return GenericMain(commands, aliases=aliases)
......@@ -1119,13 +1119,13 @@ def _FormatList(buf, data, indent_level):
if isinstance(elem, tuple)] or [0])
for elem in data:
if isinstance(elem, basestring):
buf.write("%*s%s\n" % (2*indent_level, "", elem))
buf.write("%*s%s\n" % (2 * indent_level, "", elem))
elif isinstance(elem, tuple):
key, value = elem
spacer = "%*s" % (max_tlen - len(key), "")
buf.write("%*s%s:%s %s\n" % (2*indent_level, "", key, spacer, value))
buf.write("%*s%s:%s %s\n" % (2 * indent_level, "", key, spacer, value))
elif isinstance(elem, list):
_FormatList(buf, elem, indent_level+1)
_FormatList(buf, elem, indent_level + 1)
def ShowInstanceConfig(opts, args):
......@@ -1179,7 +1179,7 @@ def ShowInstanceConfig(opts, args):
buf.write(" Operating system: %s\n" % instance["os"])
FormatParameterDict(buf, instance["os_instance"], instance["os_actual"],
level=2)
if instance.has_key("network_port"):
if "network_port" in instance:
buf.write(" Allocated network port: %s\n" %
compat.TryToRoman(instance["network_port"],
convert=opts.roman_integers))
......
......@@ -4085,6 +4085,7 @@ class LUOobCommand(NoHooksLU):
raise errors.OpExecError("Check of out-of-band payload failed due to %s" %
utils.CommaJoin(errs))
class _OsQuery(_QueryBase):
FIELDS = query.OS_FIELDS
......@@ -7950,7 +7951,7 @@ def _ComputeDiskSizePerVG(disk_template, disks):
if disk_template not in req_size_dict:
raise errors.ProgrammerError("Disk template '%s' size requirement"
" is unknown" % disk_template)
" is unknown" % disk_template)
return req_size_dict[disk_template]
......@@ -7972,7 +7973,7 @@ def _ComputeDiskSize(disk_template, disks):
if disk_template not in req_size_dict:
raise errors.ProgrammerError("Disk template '%s' size requirement"
" is unknown" % disk_template)
" is unknown" % disk_template)
return req_size_dict[disk_template]
......@@ -8252,8 +8253,8 @@ class LUInstanceCreate(LogicalUnit):
self.needed_locks[locking.LEVEL_NODE] = locking.ALL_SET
self.op.src_node = None
if os.path.isabs(src_path):
raise errors.OpPrereqError("Importing an instance from an absolute"
" path requires a source node option",
raise errors.OpPrereqError("Importing an instance from a path"
" requires a source node option",
errors.ECODE_INVAL)
else:
self.op.src_node = src_node = _ExpandNodeName(self.cfg, src_node)
......@@ -8883,7 +8884,7 @@ class LUInstanceCreate(LogicalUnit):
# 'fake' LV disks with the old data, plus the new unique_id
tmp_disks = [objects.Disk.FromDict(v.ToDict()) for v in disks]
rename_to = []
for t_dsk, a_dsk in zip (tmp_disks, self.disks):
for t_dsk, a_dsk in zip(tmp_disks, self.disks):
rename_to.append(t_dsk.logical_id)
t_dsk.logical_id = (t_dsk.logical_id[0], a_dsk[constants.IDISK_ADOPT])
self.cfg.SetDiskID(t_dsk, pnode_name)
......@@ -10823,7 +10824,7 @@ class LUInstanceSetParams(LogicalUnit):
if msg:
# Assume the primary node is unreachable and go ahead
self.warn.append("Can't get info from primary node %s: %s" %
(pnode, msg))
(pnode, msg))
elif not isinstance(pninfo.payload.get("memory_free", None), int):
self.warn.append("Node data from primary node %s doesn't contain"
" free memory information" % pnode)
......@@ -12140,7 +12141,6 @@ class LUGroupSetParams(LogicalUnit):
return result
class LUGroupRemove(LogicalUnit):
HPATH = "group-remove"
HTYPE = constants.HTYPE_GROUP
......
......@@ -67,6 +67,7 @@ def _all(seq):
return False
return True
def _any(seq):
"""Returns True if any element of the iterable are True.
......@@ -75,6 +76,7 @@ def _any(seq):
return True
return False
try:
# pylint: disable-msg=E0601
# pylint: disable-msg=W0622
......@@ -89,6 +91,7 @@ try:
except NameError:
any = _any
def partition(seq, pred=bool): # pylint: disable-msg=W0622
"""Partition a list in two, based on the given predicate.
......
......@@ -50,4 +50,3 @@ def UnpackMagic(payload):
raise errors.ConfdMagicError("UDP payload contains an unkown fourcc")
return payload[_FOURCC_LEN:]
......@@ -333,7 +333,7 @@ class ConfdClient:
elif peer_cnt < 5:
return peer_cnt - 1
else:
return int(peer_cnt/2) + 1
return int(peer_cnt / 2) + 1
def WaitForReply(self, salt, timeout=constants.CONFD_CLIENT_EXPIRE_TIMEOUT):
"""Wait for replies to a given request.
......
#
#
# Copyright (C) 2009, Google Inc.
# Copyright (C) 2009 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......
#
#
# Copyright (C) 2009, Google Inc.
# Copyright (C) 2009 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......
......@@ -539,7 +539,6 @@ class ConfigWriter:
cluster.SimpleFillND(nodegroup.ndparams),
constants.NDS_PARAMETER_TYPES)
# drbd minors check
_, duplicates = self._UnlockedComputeDRBDMap()
for node, minor, instance_a, instance_b in duplicates:
......
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