Revision e0e916fe daemons/ganeti-masterd
b/daemons/ganeti-masterd | ||
---|---|---|
402 | 402 |
return until |
403 | 403 |
|
404 | 404 |
|
405 |
@rpc.RunWithRPC |
|
405 | 406 |
def CheckAgreement(): |
406 | 407 |
"""Check the agreement on who is the master. |
407 | 408 |
|
... | ... | |
462 | 463 |
return result |
463 | 464 |
|
464 | 465 |
|
465 |
def CheckAgreementWithRpc(): |
|
466 |
rpc.Init() |
|
467 |
try: |
|
468 |
return CheckAgreement() |
|
469 |
finally: |
|
470 |
rpc.Shutdown() |
|
471 |
|
|
472 |
|
|
473 | 466 |
def CheckMasterd(options, args): |
474 | 467 |
"""Initial checks whether to run or exit with a failure. |
475 | 468 |
|
... | ... | |
509 | 502 |
|
510 | 503 |
# CheckAgreement uses RPC and threads, hence it needs to be run in a separate |
511 | 504 |
# process before we call utils.Daemonize in the current process. |
512 |
if not utils.RunInSeparateProcess(CheckAgreementWithRpc):
|
|
505 |
if not utils.RunInSeparateProcess(CheckAgreement): |
|
513 | 506 |
sys.exit(constants.EXIT_FAILURE) |
514 | 507 |
|
515 | 508 |
|
Also available in: Unified diff