Revision 80a56f26 lib/bootstrap.py
b/lib/bootstrap.py | ||
---|---|---|
991 | 991 |
logging.info("Setting master to %s, old master: %s", new_master, old_master) |
992 | 992 |
|
993 | 993 |
try: |
994 |
# Start WConfd so that we can access the configuration |
|
995 |
result = utils.RunCmd([pathutils.DAEMON_UTIL, |
|
996 |
"start", constants.WCONFD, "--force-node"]) |
|
997 |
if result.failed: |
|
998 |
raise errors.OpPrereqError("Could not start the configuration daemon," |
|
999 |
" command %s had exitcode %s and error %s" % |
|
1000 |
(result.cmd, result.exit_code, result.output), |
|
1001 |
errors.ECODE_NOENT) |
|
1002 |
|
|
994 | 1003 |
# instantiate a real config writer, as we now know we have the |
995 | 1004 |
# configuration data |
996 | 1005 |
cfg = config.ConfigWriter(accept_foreign=True) |
... | ... | |
1016 | 1025 |
logging.error("Error while trying to set the new master: %s", |
1017 | 1026 |
str(err)) |
1018 | 1027 |
return 1 |
1028 |
finally: |
|
1029 |
# stop WConfd again: |
|
1030 |
result = utils.RunCmd([pathutils.DAEMON_UTIL, "stop", constants.WCONFD]) |
|
1031 |
if result.failed: |
|
1032 |
logging.error("Could not stop the configuration daemon," |
|
1033 |
" command %s had exitcode %s and error %s", |
|
1034 |
result.cmd, result.exit_code, result.output) |
|
1019 | 1035 |
|
1020 | 1036 |
# if cfg.Update worked, then it means the old master daemon won't be |
1021 | 1037 |
# able now to write its own config file (we rely on locking in both |
Also available in: Unified diff