Revision e431074f lib/cmdlib.py
b/lib/cmdlib.py | ||
---|---|---|
3873 | 3873 |
instance_names = self._GetNames(lu, all_info.keys(), locking.LEVEL_INSTANCE) |
3874 | 3874 |
|
3875 | 3875 |
instance_list = [all_info[name] for name in instance_names] |
3876 |
nodes = frozenset([inst.primary_node for inst in instance_list]) |
|
3876 |
nodes = frozenset(itertools.chain(*(inst.all_nodes |
|
3877 |
for inst in instance_list))) |
|
3877 | 3878 |
hv_list = list(set([inst.hypervisor for inst in instance_list])) |
3878 | 3879 |
bad_nodes = [] |
3879 | 3880 |
offline_nodes = [] |
3881 |
wrongnode_inst = set() |
|
3880 | 3882 |
|
3881 | 3883 |
# Gather data as requested |
3882 | 3884 |
if query.IQ_LIVE in self.requested_data: |
... | ... | |
3891 | 3893 |
if result.fail_msg: |
3892 | 3894 |
bad_nodes.append(name) |
3893 | 3895 |
elif result.payload: |
3894 |
live_data.update(result.payload) |
|
3896 |
for inst in result.payload: |
|
3897 |
if all_info[inst].primary_node == name: |
|
3898 |
live_data.update(result.payload) |
|
3899 |
else: |
|
3900 |
wrongnode_inst.add(inst) |
|
3895 | 3901 |
# else no instance is alive |
3896 | 3902 |
else: |
3897 | 3903 |
live_data = {} |
... | ... | |
3907 | 3913 |
|
3908 | 3914 |
return query.InstanceQueryData(instance_list, lu.cfg.GetClusterInfo(), |
3909 | 3915 |
disk_usage, offline_nodes, bad_nodes, |
3910 |
live_data) |
|
3916 |
live_data, wrongnode_inst)
|
|
3911 | 3917 |
|
3912 | 3918 |
|
3913 | 3919 |
class LUQuery(NoHooksLU): |
Also available in: Unified diff