Revision 5d672980
b/daemons/ganeti-noded | ||
---|---|---|
605 | 605 |
|
606 | 606 |
return backend.JobQueueRename(old, new) |
607 | 607 |
|
608 |
@staticmethod |
|
609 |
def perspective_jobqueue_set_drain(params): |
|
610 |
"""Set/unset the queue drain flag. |
|
611 |
|
|
612 |
""" |
|
613 |
drain_flag = params[0] |
|
614 |
return backend.JobQueueSetDrainFlag(drain_flag) |
|
615 |
|
|
616 |
|
|
608 | 617 |
# hypervisor --------------- |
609 | 618 |
|
610 | 619 |
@staticmethod |
b/lib/backend.py | ||
---|---|---|
1773 | 1773 |
return True |
1774 | 1774 |
|
1775 | 1775 |
|
1776 |
def JobQueueSetDrainFlag(drain_flag): |
|
1777 |
"""Set the drain flag for the queue. |
|
1778 |
|
|
1779 |
This will set or unset the queue drain flag. |
|
1780 |
|
|
1781 |
@type drain_flag: bool |
|
1782 |
@param drain_flag: if True, will set the drain flag, otherwise reset it. |
|
1783 |
|
|
1784 |
""" |
|
1785 |
if drain_flag: |
|
1786 |
utils.WriteFile(constants.JOB_QUEUE_DRAIN_FILE, data="", close=True) |
|
1787 |
else: |
|
1788 |
utils.RemoveFile(constants.JOB_QUEUE_DRAIN_FILE) |
|
1789 |
|
|
1790 |
return True |
|
1791 |
|
|
1792 |
|
|
1776 | 1793 |
def CloseBlockDevices(disks): |
1777 | 1794 |
"""Closes the given block devices. |
1778 | 1795 |
|
b/lib/rpc.py | ||
---|---|---|
900 | 900 |
return result |
901 | 901 |
|
902 | 902 |
|
903 |
@staticmethod |
|
904 |
def call_jobqueue_set_drain(node_list, drain_flag): |
|
905 |
"""Set the drain flag on the queue. |
|
906 |
|
|
907 |
This is a multi-node call. |
|
908 |
|
|
909 |
@type node_list: list |
|
910 |
@param node_list: the list of nodes to query |
|
911 |
@type drain_flag: bool |
|
912 |
@param drain_flag: if True, will set the drain flag, otherwise reset it. |
|
913 |
|
|
914 |
""" |
|
915 |
c = Client("jobqueue_set_drain", [drain_flag]) |
|
916 |
c.connect_list(node_list) |
|
917 |
c.run() |
|
918 |
result = c.getresult() |
|
919 |
return result |
|
920 |
|
|
921 |
|
|
903 | 922 |
def call_hypervisor_validate_params(self, node_list, hvname, hvparams): |
904 | 923 |
"""Validate the hypervisor params. |
905 | 924 |
|
Also available in: Unified diff