Merge branch 'stable-2.15' into stable-2.16
authorBrian Foley <bpfoley@google.com>
Fri, 16 Dec 2016 17:12:37 +0000 (17:12 +0000)
committerBrian Foley <bpfoley@google.com>
Fri, 16 Dec 2016 17:12:37 +0000 (17:12 +0000)
Merge forward mostly cleanup patches from stable-2.15

* stable-2.15
  Fix gnt-instance console instance unpausing for xl toolstack
  Disable pylint too-many-nested-blocks in _RunCmdPipe
  Reduce nesting in import-export ProcessChildIO
  Reduce nesting in LUOobCommand.Exec
  Reduce nesting in LUInstanceCreate.RunOsScripts
  Reduce nesting in RemoveNodeSshKeyBulk key calculation
  Reduce nesting in RemoveNodeSshKeyBulk ssh logic
  Reduce nesting in gnt-cluster VerifyDisks missing disk loop
  Reduce nesting in _CheckVLANArguments
  Reduce nesting in StartDaemon
  Disable pylint bad-continuation warning
  Disable pylint superfluous-parens warning
  Disable pylint redefined-variable-type warning
  Disable pylint too-many-branches warnings
  Disable pylint broad-except warnings
  Disable incorrect pylint assigning-non-slot warning
  Quell pylint unbalanced-tuple-unpacking warning
  Cleanup: Use new-style classes everywhere
  Quell pylint socket.timeout warning
  Quell the pylint wrong-import-order warnings
  Quell cell-var-from-loop warning
  Use default value lambda param to avoid cell-var-from-loop
  Quell too-many-boolean-expressions
  Remove pylint tests removed in pylint 2.0
  Quell trailing newline
  Quell bad-whitespace warning
  Quell consider-using-enumerate warning
  Disable pylint unsubscriptable-object warning
  Disable pylint bare-except warning
  Disable unwanted pylint wrong-import-position warnings
  Disable pylint unused-wildcard-import warning
  Disable incorrect pylint not-callable warning
  Disable pylint unpacking-non-sequence warning
  Disable pylint misplaced-comparison-constant warning
  Disable incorect pylint simplify-if-statement warning
  Disable pylint eval-used warning
  Disable pylint invalid-name warning
  Disable pylint import-self warning
  Disable some pylint unused-import warnings
  Replace deprecated pylint >=0.27 pragma with new form
  Delete old warning disables removed from pylint 1.6
  Fix pylint >1.4 pycurl no-member warnings
  Cleanup: Remove unused/duplicate module/fn import
  Cleanup: Fix unidiomatic-typecheck
  Cleanup: Remove some unneeded pylint disables
  Cleanup: Iterate dict rather than key list
  Cleanup: Remove unused format key
  Cleanup: StartInstance and RebootInstance return None
  Cleanup: Fix for/else with no break in AddAuthorizedKeys
  Cleanup: Replace map/filters with list comprehensions
  Cleanup: del is a statement not a function
  Cleanup: Use FOO not in BAR instead of not FOO in BAR
  Cleanup: Simplify boolean assignment
  Cleanup: Remove some unnecessary if (...) parens
  Fix invalid variable error for file-based disks
  FIX: Refactor DiagnoseOS to use a loop, not an inner fn
  FIX: Set INSTANCE_NICn_NETWORK_NAME only if net is defined
  Fix for incorrect parsing of DRBD versions
  Change a few errors to report names, not UUIDs
  Give atomicWriteFile temp filenames a more distinct pattern
  LV check failure should print instance name
  Disable logging CallRPCMethod timings in non-debug configs
  568 Update hv_kvm to handle output from qemu >= 1.6.0

Trivial merge conflicts:
  lib/cli.py                   -- whitespace
  lib/cmdlib/cluster/verify.py -- code previously removed from 2.16
  lib/hypervisor/hv_xen.py     -- tuple vs list
  lib/luxi.py                  -- whitespace
  lib/server/masterd.py        -- code cleaned up in 2.15 and
                                  previously removed in 2.16
  lib/storage/filestorage.py   -- whitespace & generator instead of list
  lib/tools/node_cleanup.py    -- whitespace

Signed-off-by: Brian Foley <bpfoley@google.com>
Reviewed-by: Federico Pareschi <morg@google.com>

42 files changed:
1  2 
Makefile.am
autotools/build-bash-completion
lib/backend.py
lib/bootstrap.py
lib/cli.py
lib/cli_opts.py
lib/client/gnt_cluster.py
lib/client/gnt_debug.py
lib/client/gnt_instance.py
lib/cmdlib/cluster/__init__.py
lib/cmdlib/cluster/verify.py
lib/cmdlib/common.py
lib/cmdlib/instance_create.py
lib/cmdlib/instance_migration.py
lib/cmdlib/instance_set_params.py
lib/cmdlib/test.py
lib/config/__init__.py
lib/errors.py
lib/http/client.py
lib/hypervisor/hv_kvm/__init__.py
lib/hypervisor/hv_kvm/monitor.py
lib/hypervisor/hv_xen.py
lib/jqueue/__init__.py
lib/masterd/iallocator.py
lib/objects.py
lib/rapi/client.py
lib/rpc/node.py
lib/rpc/transport.py
lib/rpc_defs.py
lib/server/noded.py
lib/server/rapi.py
lib/ssh.py
lib/storage/bdev.py
lib/storage/drbd.py
lib/storage/filestorage.py
lib/tools/common.py
lib/utils/__init__.py
lib/watcher/__init__.py
test/py/cmdlib/testsupport/cmdlib_testcase.py
test/py/ganeti.hypervisor.hv_kvm_unittest.py
test/py/ganeti.storage.drbd_unittest.py
test/py/testutils/config_mock.py

diff --cc Makefile.am
Simple merge
Simple merge
diff --cc lib/backend.py
Simple merge
Simple merge
diff --cc lib/cli.py
Simple merge
diff --cc lib/cli_opts.py
Simple merge
@@@ -299,19 -296,8 +301,16 @@@ def InitCluster(opts, args)
  
    default_ialloc_params = opts.default_iallocator_params
  
-   if opts.enabled_user_shutdown:
-     enabled_user_shutdown = True
-   else:
-     enabled_user_shutdown = False
+   enabled_user_shutdown = bool(opts.enabled_user_shutdown)
  
 +  if opts.ssh_key_type:
 +    ssh_key_type = opts.ssh_key_type
 +  else:
 +    ssh_key_type = constants.SSH_DEFAULT_KEY_TYPE
 +
 +  ssh_key_bits = ssh.DetermineKeyBits(ssh_key_type, opts.ssh_key_bits, None,
 +                                      None)
 +
    bootstrap.InitCluster(cluster_name=args[0],
                          secondary_ip=opts.secondary_ip,
                          vg_name=vg_name,
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc lib/errors.py
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -1141,9 -1168,118 +1141,9 @@@ class _JobProcessor(object)
          return self.DEFER
      finally:
        assert job.writable, "Job became read-only while being processed"
 -      queue.release()
 -
 -
 -def _EvaluateJobProcessorResult(depmgr, job, result):
 -  """Looks at a result from L{_JobProcessor} for a job.
 -
 -  To be used in a L{_JobQueueWorker}.
 -
 -  """
 -  if result == _JobProcessor.FINISHED:
 -    # Notify waiting jobs
 -    depmgr.NotifyWaiters(job.id)
 -
 -  elif result == _JobProcessor.DEFER:
 -    # Schedule again
 -    raise workerpool.DeferTask(priority=job.CalcPriority())
 -
 -  elif result == _JobProcessor.WAITDEP:
 -    # No-op, dependency manager will re-schedule
 -    pass
 -
 -  else:
 -    raise errors.ProgrammerError("Job processor returned unknown status %s" %
 -                                 (result, ))
 -
 -
 -class _JobQueueWorker(workerpool.BaseWorker):
 -  """The actual job workers.
 -
 -  """
 -  def RunTask(self, job): # pylint: disable=W0221
 -    """Job executor.
 -
 -    @type job: L{_QueuedJob}
 -    @param job: the job to be processed
 -
 -    """
 -    assert job.writable, "Expected writable job"
 -
 -    # Ensure only one worker is active on a single job. If a job registers for
 -    # a dependency job, and the other job notifies before the first worker is
 -    # done, the job can end up in the tasklist more than once.
 -    job.processor_lock.acquire()
 -    try:
 -      return self._RunTaskInner(job)
 -    finally:
 -      job.processor_lock.release()
 -
 -  def _RunTaskInner(self, job):
 -    """Executes a job.
 -
 -    Must be called with per-job lock acquired.
 -
 -    """
 -    queue = job.queue
 -    assert queue == self.pool.queue
 -
 -    setname_fn = lambda op: self.SetTaskName(self._GetWorkerName(job, op))
 -    setname_fn(None)
 -
 -    proc = mcpu.Processor(queue.context, job.id)
 -
 -    # Create wrapper for setting thread name
 -    wrap_execop_fn = compat.partial(self._WrapExecOpCode, setname_fn,
 -                                    proc.ExecOpCode)
 -
 -    _EvaluateJobProcessorResult(queue.depmgr, job,
 -                                _JobProcessor(queue, wrap_execop_fn, job)())
 -
 -  @staticmethod
 -  def _WrapExecOpCode(setname_fn, execop_fn, op, *args, **kwargs):
 -    """Updates the worker thread name to include a short summary of the opcode.
 -
 -    @param setname_fn: Callable setting worker thread name
 -    @param execop_fn: Callable for executing opcode (usually
 -                      L{mcpu.Processor.ExecOpCode})
 -
 -    """
 -    setname_fn(op)
 -    try:
 -      return execop_fn(op, *args, **kwargs)
 -    finally:
 -      setname_fn(None)
 -
 -  @staticmethod
 -  def _GetWorkerName(job, op):
 -    """Sets the worker thread name.
 -
 -    @type job: L{_QueuedJob}
 -    @type op: L{opcodes.OpCode}
 -
 -    """
 -    parts = ["Job%s" % job.id]
 -
 -    if op:
 -      parts.append(op.TinySummary())
 -
 -    return "/".join(parts)
 -
 -
 -class _JobQueueWorkerPool(workerpool.WorkerPool):
 -  """Simple class implementing a job-processing workerpool.
 -
 -  """
 -  def __init__(self, queue):
 -    super(_JobQueueWorkerPool, self).__init__("Jq",
 -                                              JOBQUEUE_THREADS,
 -                                              _JobQueueWorker)
 -    self.queue = queue
  
  
- class _JobDependencyManager:
+ class _JobDependencyManager(object):
    """Keeps track of job dependencies.
  
    """
Simple merge
diff --cc lib/objects.py
Simple merge
Simple merge
diff --cc lib/rpc/node.py
Simple merge
Simple merge
diff --cc lib/rpc_defs.py
Simple merge
Simple merge
Simple merge
diff --cc lib/ssh.py
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge