Revision e431074f lib/query.py
b/lib/query.py | ||
---|---|---|
664 | 664 |
|
665 | 665 |
""" |
666 | 666 |
def __init__(self, instances, cluster, disk_usage, offline_nodes, bad_nodes, |
667 |
live_data): |
|
667 |
live_data, wrongnode_inst):
|
|
668 | 668 |
"""Initializes this class. |
669 | 669 |
|
670 | 670 |
@param instances: List of instance objects |
... | ... | |
677 | 677 |
@param bad_nodes: List of faulty nodes |
678 | 678 |
@type live_data: dict; instance name as key |
679 | 679 |
@param live_data: Per-instance live data |
680 |
@type wrongnode_inst: set |
|
681 |
@param wrongnode_inst: Set of instances running on wrong node(s) |
|
680 | 682 |
|
681 | 683 |
""" |
682 | 684 |
assert len(set(bad_nodes) & set(offline_nodes)) == len(offline_nodes), \ |
... | ... | |
690 | 692 |
self.offline_nodes = offline_nodes |
691 | 693 |
self.bad_nodes = bad_nodes |
692 | 694 |
self.live_data = live_data |
695 |
self.wrongnode_inst = wrongnode_inst |
|
693 | 696 |
|
694 | 697 |
# Used for individual rows |
695 | 698 |
self.inst_hvparams = None |
... | ... | |
774 | 777 |
return "ERROR_nodedown" |
775 | 778 |
|
776 | 779 |
if bool(ctx.live_data.get(inst.name)): |
777 |
if inst.admin_up: |
|
780 |
if inst.name in ctx.wrongnode_inst: |
|
781 |
return "ERROR_wrongnode" |
|
782 |
elif inst.admin_up: |
|
778 | 783 |
return "running" |
779 | 784 |
else: |
780 | 785 |
return "ERROR_up" |
Also available in: Unified diff