Revision 1bc59f76
b/lib/backend.py | ||
---|---|---|
69 | 69 |
utils.RemoveFile(full_name) |
70 | 70 |
|
71 | 71 |
|
72 |
def _JobQueuePurge(keep_lock):
|
|
72 |
def JobQueuePurge():
|
|
73 | 73 |
"""Removes job queue files and archived jobs |
74 | 74 |
|
75 | 75 |
""" |
76 |
if keep_lock: |
|
77 |
exclude = [constants.JOB_QUEUE_LOCK_FILE] |
|
78 |
else: |
|
79 |
exclude = [] |
|
80 |
|
|
81 |
_CleanDirectory(constants.QUEUE_DIR, exclude=exclude) |
|
76 |
_CleanDirectory(constants.QUEUE_DIR, exclude=[constants.JOB_QUEUE_LOCK_FILE]) |
|
82 | 77 |
_CleanDirectory(constants.JOB_QUEUE_ARCHIVE_DIR) |
83 | 78 |
|
84 | 79 |
|
... | ... | |
211 | 206 |
|
212 | 207 |
""" |
213 | 208 |
_CleanDirectory(constants.DATA_DIR) |
214 |
|
|
215 |
# The lock can be removed because we're going to quit anyway. |
|
216 |
_JobQueuePurge(keep_lock=False) |
|
209 |
JobQueuePurge() |
|
217 | 210 |
|
218 | 211 |
try: |
219 | 212 |
priv_key, pub_key, auth_keys = ssh.GetUserFiles(constants.GANETI_RUNAS) |
... | ... | |
1717 | 1710 |
return True |
1718 | 1711 |
|
1719 | 1712 |
|
1720 |
def JobQueuePurge(): |
|
1721 |
"""Removes job queue files and archived jobs |
|
1722 |
|
|
1723 |
""" |
|
1724 |
# The lock must not be removed, otherwise another process could create |
|
1725 |
# it again. |
|
1726 |
return _JobQueuePurge(keep_lock=True) |
|
1727 |
|
|
1728 |
|
|
1729 | 1713 |
def JobQueueRename(old, new): |
1730 | 1714 |
"""Renames a job queue file. |
1731 | 1715 |
|
Also available in: Unified diff