Revision 3da6e141 lib/config.py

b/lib/config.py
577 577
    invalid_hvs = set(cluster.enabled_hypervisors) - constants.HYPER_TYPES
578 578
    if invalid_hvs:
579 579
      result.append("enabled hypervisors contains invalid entries: %s" %
580
                    invalid_hvs)
580
                    utils.CommaJoin(invalid_hvs))
581 581
    missing_hvp = (set(cluster.enabled_hypervisors) -
582 582
                   set(cluster.hvparams.keys()))
583 583
    if missing_hvp:
584 584
      result.append("hypervisor parameters missing for the enabled"
585 585
                    " hypervisor(s) %s" % utils.CommaJoin(missing_hvp))
586 586

  
587
    if not cluster.enabled_disk_templates:
588
      result.append("enabled disk templates list doesn't have any entries")
589
    invalid_disk_templates = set(cluster.enabled_disk_templates) \
590
                               - constants.DISK_TEMPLATES
591
    if invalid_disk_templates:
592
      result.append("enabled disk templates list contains invalid entries:"
593
                    " %s" % utils.CommaJoin(invalid_disk_templates))
594

  
587 595
    if cluster.master_node not in data.nodes:
588 596
      result.append("cluster has invalid primary node '%s'" %
589 597
                    cluster.master_node)
......
663 671
                  filled, constants.NICS_PARAMETER_TYPES)
664 672
          _helper_nic(owner, filled)
665 673

  
674
      # disk template checks
675
      if not instance.disk_template in data.cluster.enabled_disk_templates:
676
        result.append("instance '%s' uses the disabled disk template '%s'." %
677
                      (instance_name, instance.disk_template))
678

  
666 679
      # parameter checks
667 680
      if instance.beparams:
668 681
        _helper("instance %s" % instance.name, "beparams",

Also available in: Unified diff