Revision 6abf7f2c lib/backend.py
b/lib/backend.py | ||
---|---|---|
2357 | 2357 |
utils.RenameFile(old, new, mkdir=True) |
2358 | 2358 |
|
2359 | 2359 |
|
2360 |
def JobQueueSetDrainFlag(drain_flag): |
|
2361 |
"""Set the drain flag for the queue. |
|
2362 |
|
|
2363 |
This will set or unset the queue drain flag. |
|
2364 |
|
|
2365 |
@type drain_flag: boolean |
|
2366 |
@param drain_flag: if True, will set the drain flag, otherwise reset it. |
|
2367 |
@rtype: truple |
|
2368 |
@return: always True, None |
|
2369 |
@warning: the function always returns True |
|
2370 |
|
|
2371 |
""" |
|
2372 |
if drain_flag: |
|
2373 |
utils.WriteFile(constants.JOB_QUEUE_DRAIN_FILE, data="", close=True) |
|
2374 |
else: |
|
2375 |
utils.RemoveFile(constants.JOB_QUEUE_DRAIN_FILE) |
|
2376 |
|
|
2377 |
|
|
2378 | 2360 |
def BlockdevClose(instance_name, disks): |
2379 | 2361 |
"""Closes the given block devices. |
2380 | 2362 |
|
Also available in: Unified diff