Revision 845da3e8

b/lib/backend.py
1851 1851
        return False, ("File '%s' under path '%s' is not executable" %
1852 1852
                       (filename, os_dir))
1853 1853

  
1854
  variants = None
1854
  variants = []
1855 1855
  if constants.OS_VARIANTS_FILE in os_files:
1856 1856
    variants_file = os_files[constants.OS_VARIANTS_FILE]
1857 1857
    try:
b/lib/cmdlib.py
2782 2782
        for osl in os_data.values():
2783 2783
          valid = valid and osl and osl[0][1]
2784 2784
          if not valid:
2785
            variants = None
2785
            variants = set()
2786 2786
            break
2787 2787
          if calc_variants:
2788 2788
            node_variants = osl[0][3]
2789 2789
            if variants is None:
2790
              variants = node_variants
2790
              variants = set(node_variants)
2791 2791
            else:
2792
              variants = [v for v in variants if v in node_variants]
2792
              variants.intersection_update(node_variants)
2793 2793

  
2794 2794
      for field in self.op.output_fields:
2795 2795
        if field == "name":
......
2802 2802
          for node_name, nos_list in os_data.items():
2803 2803
            val[node_name] = nos_list
2804 2804
        elif field == "variants":
2805
          val =  variants
2805
          val = list(variants)
2806 2806
        else:
2807 2807
          raise errors.ParameterError(field)
2808 2808
        row.append(val)

Also available in: Unified diff