Revision 3ee53f1f
b/daemons/ganeti-confd | ||
---|---|---|
258 | 258 |
# conflict with that. If so, we might warn or EXIT_FAILURE. |
259 | 259 |
|
260 | 260 |
|
261 |
def ExecConfd(options, _dummy1, _dummy2):
|
|
262 |
"""Main confd function, executed with PID file held
|
|
261 |
def PrepConfd(options, _):
|
|
262 |
"""Prep confd function, executed with PID file held
|
|
263 | 263 |
|
264 | 264 |
""" |
265 | 265 |
# TODO: clarify how the server and reloader variables work (they are |
266 | 266 |
# not used) |
267 |
|
|
267 | 268 |
# pylint: disable-msg=W0612 |
268 | 269 |
mainloop = daemon.Mainloop() |
269 | 270 |
|
... | ... | |
281 | 282 |
# Configuration reloader |
282 | 283 |
reloader = ConfdConfigurationReloader(processor, mainloop) |
283 | 284 |
|
285 |
return mainloop |
|
286 |
|
|
287 |
|
|
288 |
def ExecConfd(options, args, prep_data): # pylint: disable-msg=W0613 |
|
289 |
"""Main confd function, executed with PID file held |
|
290 |
|
|
291 |
""" |
|
292 |
mainloop = prep_data |
|
284 | 293 |
mainloop.Run() |
285 | 294 |
|
286 | 295 |
|
... | ... | |
293 | 302 |
version="%%prog (ganeti) %s" % |
294 | 303 |
constants.RELEASE_VERSION) |
295 | 304 |
|
296 |
daemon.GenericMain(constants.CONFD, parser, CheckConfd, None, ExecConfd)
|
|
305 |
daemon.GenericMain(constants.CONFD, parser, CheckConfd, PrepConfd, ExecConfd)
|
|
297 | 306 |
|
298 | 307 |
|
299 | 308 |
if __name__ == "__main__": |
b/daemons/ganeti-masterd | ||
---|---|---|
530 | 530 |
utils.RunInSeparateProcess(ActivateMasterIP) |
531 | 531 |
|
532 | 532 |
|
533 |
def ExecMasterd(options, args, _): # pylint: disable-msg=W0613
|
|
534 |
"""Main master daemon function, executed with the PID file held.
|
|
533 |
def PrepMasterd(options, _):
|
|
534 |
"""Prep master daemon function, executed with the PID file held.
|
|
535 | 535 |
|
536 | 536 |
""" |
537 | 537 |
# This is safe to do as the pid file guarantees against |
... | ... | |
541 | 541 |
mainloop = daemon.Mainloop() |
542 | 542 |
master = MasterServer(mainloop, constants.MASTER_SOCKET, |
543 | 543 |
options.uid, options.gid) |
544 |
return (mainloop, master) |
|
545 |
|
|
546 |
|
|
547 |
def ExecMasterd(options, args, prep_data): # pylint: disable-msg=W0613 |
|
548 |
"""Main master daemon function, executed with the PID file held. |
|
549 |
|
|
550 |
""" |
|
551 |
(mainloop, master) = prep_data |
|
544 | 552 |
try: |
545 | 553 |
rpc.Init() |
546 | 554 |
try: |
... | ... | |
568 | 576 |
parser.add_option("--yes-do-it", dest="yes_do_it", |
569 | 577 |
help="Override interactive check for --no-voting", |
570 | 578 |
default=False, action="store_true") |
571 |
daemon.GenericMain(constants.MASTERD, parser, CheckMasterd, None,
|
|
579 |
daemon.GenericMain(constants.MASTERD, parser, CheckMasterd, PrepMasterd,
|
|
572 | 580 |
ExecMasterd, multithreaded=True) |
573 | 581 |
|
574 | 582 |
|
b/daemons/ganeti-noded | ||
---|---|---|
914 | 914 |
sys.exit(constants.EXIT_FAILURE) |
915 | 915 |
|
916 | 916 |
|
917 |
def ExecNoded(options, _dummy1, _dummy2):
|
|
918 |
"""Main node daemon function, executed with the PID file held.
|
|
917 |
def PrepNoded(options, _):
|
|
918 |
"""Preparation node daemon function, executed with the PID file held.
|
|
919 | 919 |
|
920 | 920 |
""" |
921 | 921 |
if options.mlock: |
... | ... | |
947 | 947 |
ssl_params=ssl_params, ssl_verify_peer=True, |
948 | 948 |
request_executor_class=request_executor_class) |
949 | 949 |
server.Start() |
950 |
return (mainloop, server) |
|
951 |
|
|
952 |
def ExecNoded(options, args, prep_data): # pylint: disable-msg=W0613 |
|
953 |
"""Main node daemon function, executed with the PID file held. |
|
954 |
|
|
955 |
""" |
|
956 |
(mainloop, server) = prep_data |
|
950 | 957 |
try: |
951 | 958 |
mainloop.Run() |
952 | 959 |
finally: |
... | ... | |
965 | 972 |
help="Do not mlock the node memory in ram", |
966 | 973 |
default=True, action="store_false") |
967 | 974 |
|
968 |
daemon.GenericMain(constants.NODED, parser, CheckNoded, None, ExecNoded,
|
|
975 |
daemon.GenericMain(constants.NODED, parser, CheckNoded, PrepNoded, ExecNoded,
|
|
969 | 976 |
default_ssl_cert=constants.NODED_CERT_FILE, |
970 | 977 |
default_ssl_key=constants.NODED_CERT_FILE, |
971 | 978 |
console_logging=True) |
b/daemons/ganeti-rapi | ||
---|---|---|
280 | 280 |
options.ssl_params = None |
281 | 281 |
|
282 | 282 |
|
283 |
def ExecRapi(options, _dummy1, _dummy2):
|
|
284 |
"""Main remote API function, executed with the PID file held.
|
|
283 |
def PrepRapi(options, _):
|
|
284 |
"""Prep remote API function, executed with the PID file held.
|
|
285 | 285 |
|
286 | 286 |
""" |
287 | 287 |
|
... | ... | |
301 | 301 |
# pylint: disable-msg=E1101 |
302 | 302 |
# it seems pylint doesn't see the second parent class there |
303 | 303 |
server.Start() |
304 |
return (mainloop, server) |
|
305 |
|
|
306 |
def ExecRapi(options, args, prep_data): # pylint: disable-msg=W0613 |
|
307 |
"""Main remote API function, executed with the PID file held. |
|
308 |
|
|
309 |
""" |
|
310 |
(mainloop, server) = prep_data |
|
304 | 311 |
try: |
305 | 312 |
mainloop.Run() |
306 | 313 |
finally: |
... | ... | |
315 | 322 |
usage="%prog [-f] [-d] [-p port] [-b ADDRESS]", |
316 | 323 |
version="%%prog (ganeti) %s" % constants.RELEASE_VERSION) |
317 | 324 |
|
318 |
daemon.GenericMain(constants.RAPI, parser, CheckRapi, None, ExecRapi,
|
|
325 |
daemon.GenericMain(constants.RAPI, parser, CheckRapi, PrepRapi, ExecRapi,
|
|
319 | 326 |
default_ssl_cert=constants.RAPI_CERT_FILE, |
320 | 327 |
default_ssl_key=constants.RAPI_CERT_FILE) |
321 | 328 |
|
Also available in: Unified diff