|
|
@ -305,15 +305,15 @@ def main():
|
|
|
|
masterstatus = get_master_status(cursor)
|
|
|
|
masterstatus = get_master_status(cursor)
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
module.exit_json( **masterstatus )
|
|
|
|
module.exit_json( **masterstatus )
|
|
|
|
except TypeError, e:
|
|
|
|
except TypeError:
|
|
|
|
module.fail_json(msg="Server is not configured as mysql master: %s" % e)
|
|
|
|
module.fail_json(msg="Server is not configured as mysql master")
|
|
|
|
|
|
|
|
|
|
|
|
elif mode in "getslave":
|
|
|
|
elif mode in "getslave":
|
|
|
|
slavestatus = get_slave_status(cursor)
|
|
|
|
slavestatus = get_slave_status(cursor)
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
module.exit_json( **slavestatus )
|
|
|
|
module.exit_json( **slavestatus )
|
|
|
|
except TypeError, e:
|
|
|
|
except TypeError:
|
|
|
|
module.fail_json(msg="Server is not configured as mysql slave: %s" % e)
|
|
|
|
module.fail_json(msg="Server is not configured as mysql slave")
|
|
|
|
|
|
|
|
|
|
|
|
elif mode in "changemaster":
|
|
|
|
elif mode in "changemaster":
|
|
|
|
print "Change master"
|
|
|
|
print "Change master"
|
|
|
|