From a32869d492f5e2adbfda4a132d565c8219d18890 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Wed, 7 Jan 2015 09:20:45 -0800 Subject: [PATCH] Allow 0 to be specified --- database/mysql/mysql_replication.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/database/mysql/mysql_replication.py b/database/mysql/mysql_replication.py index f75d6a05b5d..70e226a6f5b 100644 --- a/database/mysql/mysql_replication.py +++ b/database/mysql/mysql_replication.py @@ -317,7 +317,6 @@ def main(): module.fail_json(msg="Server is not configured as mysql slave") elif mode in "changemaster": - print "Change master" chm=[] chm_params = {} if master_host: @@ -329,22 +328,22 @@ def main(): if master_password: chm.append("MASTER_PASSWORD=%(master_password)s") chm_params['master_password'] = master_password - if master_port: + if master_port is not None: chm.append("MASTER_PORT=%(master_port)s") chm_params['master_port'] = master_port - if master_connect_retry: + if master_connect_retry is not None: chm.append("MASTER_CONNECT_RETRY=%(master_connect_retry)s") chm_params['master_connect_retry'] = master_connect_retry if master_log_file: chm.append("MASTER_LOG_FILE=%(master_log_file)s") chm_params['master_log_file'] = master_log_file - if master_log_pos: + if master_log_pos is not None: chm.append("MASTER_LOG_POS=%(master_log_pos)s") chm_params['master_log_pos'] = master_log_pos if relay_log_file: chm.append("RELAY_LOG_FILE=%(relay_log_file)s") chm_params['relay_log_file'] = relay_log_file - if relay_log_pos: + if relay_log_pos is not None: chm.append("RELAY_LOG_POS=%(relay_log_pos)s") chm_params['relay_log_pos'] = relay_log_pos if master_ssl: