Revision 7c4d6c7b lib/cmdlib.py

b/lib/cmdlib.py
26 26
import os
27 27
import os.path
28 28
import time
29
import tempfile
30 29
import re
31 30
import platform
32 31
import logging
33 32
import copy
34
import random
35 33

  
36 34
from ganeti import ssh
37 35
from ganeti import utils
......
40 38
from ganeti import locking
41 39
from ganeti import constants
42 40
from ganeti import objects
43
from ganeti import opcodes
44 41
from ganeti import serializer
45 42
from ganeti import ssconf
46 43

  
......
454 451

  
455 452
def _BuildInstanceHookEnv(name, primary_node, secondary_nodes, os_type, status,
456 453
                          memory, vcpus, nics, disk_template, disks,
457
                          bep, hvp, hypervisor):
454
                          bep, hvp, hypervisor_name):
458 455
  """Builds instance related env variables for hooks
459 456

  
460 457
  This builds the hook environment from individual variables.
......
484 481
  @param bep: the backend parameters for the instance
485 482
  @type hvp: dict
486 483
  @param hvp: the hypervisor parameters for the instance
487
  @type hypervisor: string
488
  @param hypervisor: the hypervisor for the instance
484
  @type hypervisor_name: string
485
  @param hypervisor_name: the hypervisor for the instance
489 486
  @rtype: dict
490 487
  @return: the hook environment for this instance
491 488

  
......
504 501
    "INSTANCE_MEMORY": memory,
505 502
    "INSTANCE_VCPUS": vcpus,
506 503
    "INSTANCE_DISK_TEMPLATE": disk_template,
507
    "INSTANCE_HYPERVISOR": hypervisor,
504
    "INSTANCE_HYPERVISOR": hypervisor_name,
508 505
  }
509 506

  
510 507
  if nics:
......
1293 1290

  
1294 1291
    node_lvs = self.rpc.call_volume_list(nodes, vg_name)
1295 1292

  
1296
    to_act = set()
1297 1293
    for node in nodes:
1298 1294
      # node_volume
1299 1295
      lvs = node_lvs[node]
......
2513 2509
      "master": cluster.master_node,
2514 2510
      "default_hypervisor": cluster.default_hypervisor,
2515 2511
      "enabled_hypervisors": cluster.enabled_hypervisors,
2516
      "hvparams": dict([(hypervisor, cluster.hvparams[hypervisor])
2517
                        for hypervisor in cluster.enabled_hypervisors]),
2512
      "hvparams": dict([(hypervisor_name, cluster.hvparams[hypervisor])
2513
                        for hypervisor_name in cluster.enabled_hypervisors]),
2518 2514
      "beparams": cluster.beparams,
2519 2515
      "candidate_pool_size": cluster.candidate_pool_size,
2520 2516
      "default_bridge": cluster.default_bridge,
......
2677 2673
  """Start the disks of an instance.
2678 2674

  
2679 2675
  """
2680
  disks_ok, dummy = _AssembleInstanceDisks(lu, instance,
2676
  disks_ok, _ = _AssembleInstanceDisks(lu, instance,
2681 2677
                                           ignore_secondaries=force)
2682 2678
  if not disks_ok:
2683 2679
    _ShutdownInstanceDisks(lu, instance)
......
3675 3671
      logging.info("Starting instance %s on node %s",
3676 3672
                   instance.name, target_node)
3677 3673

  
3678
      disks_ok, dummy = _AssembleInstanceDisks(self, instance,
3674
      disks_ok, _ = _AssembleInstanceDisks(self, instance,
3679 3675
                                               ignore_secondaries=True)
3680 3676
      if not disks_ok:
3681 3677
        _ShutdownInstanceDisks(self, instance)
......
5431 5427
    logging.debug("Allocated minors %s" % (minors,))
5432 5428
    self.proc.LogStep(4, steps_total, "changing drbd configuration")
5433 5429
    for idx, (dev, new_minor) in enumerate(zip(instance.disks, minors)):
5434
      size = dev.size
5435 5430
      info("activating a new drbd on %s for disk/%d" % (new_node, idx))
5436 5431
      # create new devices on new_node; note that we create two IDs:
5437 5432
      # one without port, so the drbd will be activated without
......
5966 5961
    This only checks the instance list against the existing names.
5967 5962

  
5968 5963
    """
5969
    force = self.force = self.op.force
5964
    self.force = self.op.force
5970 5965

  
5971 5966
    # checking the new params on the primary/secondary nodes
5972 5967

  
......
6942 6937
    """
6943 6938
    if call_fn is None:
6944 6939
      call_fn = self.lu.rpc.call_iallocator_runner
6945
    data = self.in_text
6946 6940

  
6947 6941
    result = call_fn(self.lu.cfg.GetMasterNode(), name, self.in_text)
6948 6942
    result.Raise()

Also available in: Unified diff