Revision 016d04b3

b/lib/hypervisor/hv_xen.py
493 493

  
494 494
  PARAMETERS = {
495 495
    constants.HV_ACPI: hv_base.NO_CHECK,
496
    constants.HV_BOOT_ORDER: (True, ) + \
497
    (lambda x: x and len(x.strip("acdn")) == 0,
498
     "Invalid boot order specified, must be one or more of [acdn]",
499
     None, None),
496
    constants.HV_BOOT_ORDER: (True, ) +
497
      (lambda x: x and len(x.strip("acdn")) == 0,
498
       "Invalid boot order specified, must be one or more of [acdn]",
499
       None, None),
500 500
    constants.HV_CDROM_IMAGE_PATH: hv_base.OPT_FILE_CHECK,
501
    constants.HV_DISK_TYPE: \
502
    hv_base.ParamInSet(True, constants.HT_HVM_VALID_DISK_TYPES),
503
    constants.HV_NIC_TYPE: \
504
    hv_base.ParamInSet(True, constants.HT_HVM_VALID_NIC_TYPES),
501
    constants.HV_DISK_TYPE:
502
      hv_base.ParamInSet(True, constants.HT_HVM_VALID_DISK_TYPES),
503
    constants.HV_NIC_TYPE:
504
      hv_base.ParamInSet(True, constants.HT_HVM_VALID_NIC_TYPES),
505 505
    constants.HV_PAE: hv_base.NO_CHECK,
506
    constants.HV_VNC_BIND_ADDRESS: \
507
    (False, utils.IsValidIP,
508
     "VNC bind address is not a valid IP address", None, None),
506
    constants.HV_VNC_BIND_ADDRESS:
507
      (False, utils.IsValidIP,
508
       "VNC bind address is not a valid IP address", None, None),
509 509
    constants.HV_KERNEL_PATH: hv_base.REQ_FILE_CHECK,
510 510
    constants.HV_DEVICE_MODEL: hv_base.REQ_FILE_CHECK,
511 511
    }
b/lib/objects.py
285 285

  
286 286
class ConfigData(ConfigObject):
287 287
  """Top-level config object."""
288
  __slots__ = ["version", "cluster", "nodes", "instances", "serial_no"] + \
289
              _TIMESTAMPS
288
  __slots__ = (["version", "cluster", "nodes", "instances", "serial_no"] +
289
               _TIMESTAMPS)
290 290

  
291 291
  def ToDict(self):
292 292
    """Custom function for top-level config data.
......
828 828

  
829 829
    # default_hypervisor is just the first enabled one in 2.1
830 830
    if self.default_hypervisor is not None:
831
      self.enabled_hypervisors = [self.default_hypervisor] + \
831
      self.enabled_hypervisors = ([self.default_hypervisor] +
832 832
        [hvname for hvname in self.enabled_hypervisors
833
         if hvname != self.default_hypervisor]
833
         if hvname != self.default_hypervisor])
834 834
      self.default_hypervisor = None
835 835

  
836

  
837 836
  def ToDict(self):
838 837
    """Custom function for cluster.
839 838

  
b/lib/utils.py
1767 1767
      # we need to re-raise the exception
1768 1768
      raise
1769 1769

  
1770

  
1770 1771
def IsNormAbsPath(path):
1771 1772
  """Check whether a path is absolute and also normalized
1772 1773

  
......
1775 1776
  """
1776 1777
  return os.path.normpath(path) == path and os.path.isabs(path)
1777 1778

  
1779

  
1778 1780
def TailFile(fname, lines=20):
1779 1781
  """Return the last lines from a file.
1780 1782

  

Also available in: Unified diff