Revision 1c3231aa lib/cmdlib/operating_system.py

b/lib/cmdlib/operating_system.py
58 58

  
59 59
    @rtype: dict
60 60
    @return: a dictionary with osnames as keys and as value another
61
        map, with nodes as keys and tuples of (path, status, diagnose,
61
        map, with node UUIDs as keys and tuples of (path, status, diagnose,
62 62
        variants, parameters, api_versions) as values, eg::
63 63

  
64
          {"debian-etch": {"node1": [(/usr/lib/..., True, "", [], []),
65
                                     (/srv/..., False, "invalid api")],
66
                           "node2": [(/srv/..., True, "", [], [])]}
64
          {"debian-etch": {"node1-uuid": [(/usr/lib/..., True, "", [], []),
65
                                          (/srv/..., False, "invalid api")],
66
                           "node2-uuid": [(/srv/..., True, "", [], [])]}
67 67
          }
68 68

  
69 69
    """
......
71 71
    # we build here the list of nodes that didn't fail the RPC (at RPC
72 72
    # level), so that nodes with a non-responding node daemon don't
73 73
    # make all OSes invalid
74
    good_nodes = [node_name for node_name in rlist
75
                  if not rlist[node_name].fail_msg]
76
    for node_name, nr in rlist.items():
74
    good_node_uuids = [node_uuid for node_uuid in rlist
75
                       if not rlist[node_uuid].fail_msg]
76
    for node_uuid, nr in rlist.items():
77 77
      if nr.fail_msg or not nr.payload:
78 78
        continue
79 79
      for (name, path, status, diagnose, variants,
......
82 82
          # build a list of nodes for this os containing empty lists
83 83
          # for each node in node_list
84 84
          all_os[name] = {}
85
          for nname in good_nodes:
86
            all_os[name][nname] = []
85
          for nuuid in good_node_uuids:
86
            all_os[name][nuuid] = []
87 87
        # convert params from [name, help] to (name, help)
88 88
        params = [tuple(v) for v in params]
89
        all_os[name][node_name].append((path, status, diagnose,
89
        all_os[name][node_uuid].append((path, status, diagnose,
90 90
                                        variants, params, api_versions))
91 91
    return all_os
92 92

  
......
100 100
                           if level != locking.LEVEL_CLUSTER) or
101 101
                self.do_locking or self.use_locking)
102 102

  
103
    valid_nodes = [node.name
104
                   for node in lu.cfg.GetAllNodesInfo().values()
105
                   if not node.offline and node.vm_capable]
106
    pol = self._DiagnoseByOS(lu.rpc.call_os_diagnose(valid_nodes))
103
    valid_node_uuids = [node.uuid
104
                        for node in lu.cfg.GetAllNodesInfo().values()
105
                        if not node.offline and node.vm_capable]
106
    pol = self._DiagnoseByOS(lu.rpc.call_os_diagnose(valid_node_uuids))
107 107
    cluster = lu.cfg.GetClusterInfo()
108 108

  
109 109
    data = {}

Also available in: Unified diff