Revision af5ebcb1
b/daemons/ganeti-noded | ||
---|---|---|
569 | 569 |
""" |
570 | 570 |
return backend.JobQueuePurge() |
571 | 571 |
|
572 |
@staticmethod |
|
573 |
@_RequireJobQueueLock |
|
574 |
def perspective_jobqueue_rename(params): |
|
575 |
"""Rename a job queue file. |
|
576 |
|
|
577 |
""" |
|
578 |
(old, new) = params |
|
579 |
|
|
580 |
return backend.JobQueueRename(old, new) |
|
581 |
|
|
572 | 582 |
|
573 | 583 |
class NodeDaemonHttpServer(http.HTTPServer): |
574 | 584 |
def __init__(self, server_address): |
b/lib/backend.py | ||
---|---|---|
1690 | 1690 |
_CleanDirectory(constants.JOB_QUEUE_ARCHIVE_DIR) |
1691 | 1691 |
|
1692 | 1692 |
|
1693 |
def JobQueueRename(old, new): |
|
1694 |
"""Renames a job queue file. |
|
1695 |
|
|
1696 |
""" |
|
1697 |
if not (_IsJobQueueFile(old) and _IsJobQueueFile(new)): |
|
1698 |
return False |
|
1699 |
|
|
1700 |
os.rename(old, new) |
|
1701 |
|
|
1702 |
return True |
|
1703 |
|
|
1704 |
|
|
1693 | 1705 |
def CloseBlockDevices(disks): |
1694 | 1706 |
"""Closes the given block devices. |
1695 | 1707 |
|
b/lib/rpc.py | ||
---|---|---|
826 | 826 |
c.connect(node) |
827 | 827 |
c.run() |
828 | 828 |
return c.getresult().get(node, False) |
829 |
|
|
830 |
|
|
831 |
def call_jobqueue_rename(node_list, old, new): |
|
832 |
"""Rename a job queue file. |
|
833 |
|
|
834 |
This is a multi-node call. |
|
835 |
|
|
836 |
""" |
|
837 |
c = Client("jobqueue_rename", [old, new]) |
|
838 |
c.connect_list(node_list) |
|
839 |
c.run() |
|
840 |
result = c.getresult() |
|
841 |
return result |
Also available in: Unified diff