Revision 69ab2e12

b/lib/backend.py
203 203

  
204 204
  for hv_name in constants.HYPER_TYPES:
205 205
    hv_class = hypervisor.GetHypervisorClass(hv_name)
206
    allowed_files.update(hv_class.GetAncillaryFiles())
206
    allowed_files.update(hv_class.GetAncillaryFiles()[0])
207 207

  
208 208
  return frozenset(allowed_files)
209 209

  
b/lib/cmdlib.py
3760 3760
  # Files which should only be on VM-capable nodes
3761 3761
  files_vm = set(filename
3762 3762
    for hv_name in cluster.enabled_hypervisors
3763
    for filename in hypervisor.GetHypervisor(hv_name).GetAncillaryFiles())
3763
    for filename in hypervisor.GetHypervisor(hv_name).GetAncillaryFiles()[0])
3764 3764

  
3765 3765
  # Filenames must be unique
3766 3766
  assert (len(files_all | files_all_opt | files_mc | files_vm) ==
b/lib/hypervisor/hv_base.py
133 133
  """
134 134
  PARAMETERS = {}
135 135
  ANCILLARY_FILES = []
136
  ANCILLARY_FILES_OPT = []
136 137
  CAN_MIGRATE = False
137 138

  
138 139
  def __init__(self):
......
221 222
    """Return a list of ancillary files to be copied to all nodes as ancillary
222 223
    configuration files.
223 224

  
224
    @rtype: list of strings
225
    @return: list of absolute paths of files to ship cluster-wide
225
    @rtype: (list of absolute paths, list of absolute paths)
226
    @return: (all files, optional files)
226 227

  
227 228
    """
228 229
    # By default we return a member variable, so that if an hypervisor has just
229 230
    # a static list of files it doesn't have to override this function.
230
    return cls.ANCILLARY_FILES
231
    assert set(cls.ANCILLARY_FILES).issuperset(cls.ANCILLARY_FILES_OPT), \
232
      "Optional ancillary files must be a subset of ancillary files"
233

  
234
    return (cls.ANCILLARY_FILES, cls.ANCILLARY_FILES_OPT)
231 235

  
232 236
  def Verify(self):
233 237
    """Verify the hypervisor.
b/lib/hypervisor/hv_kvm.py
475 475
  ANCILLARY_FILES = [
476 476
    _KVM_NETWORK_SCRIPT,
477 477
    ]
478
  ANCILLARY_FILES_OPT = [
479
    _KVM_NETWORK_SCRIPT,
480
    ]
478 481

  
479 482
  def __init__(self):
480 483
    hv_base.BaseHypervisor.__init__(self)
b/lib/hypervisor/hv_xen.py
55 55
    XL_CONFIG_FILE,
56 56
    VIF_BRIDGE_SCRIPT,
57 57
    ]
58
  ANCILLARY_FILES_OPT = [
59
    XL_CONFIG_FILE,
60
    ]
58 61

  
59 62
  @staticmethod
60 63
  def _ConfigFileName(instance_name):
......
589 592
  ANCILLARY_FILES = XenHypervisor.ANCILLARY_FILES + [
590 593
    constants.VNC_PASSWORD_FILE,
591 594
    ]
595
  ANCILLARY_FILES_OPT = XenHypervisor.ANCILLARY_FILES_OPT + [
596
    constants.VNC_PASSWORD_FILE,
597
    ]
592 598

  
593 599
  PARAMETERS = {
594 600
    constants.HV_ACPI: hv_base.NO_CHECK,

Also available in: Unified diff