Allow 0 to be specified

reviewable/pr18780/r1
Toshio Kuratomi 10 years ago
parent df240f7840
commit a32869d492

@ -317,7 +317,6 @@ def main():
module.fail_json(msg="Server is not configured as mysql slave") module.fail_json(msg="Server is not configured as mysql slave")
elif mode in "changemaster": elif mode in "changemaster":
print "Change master"
chm=[] chm=[]
chm_params = {} chm_params = {}
if master_host: if master_host:
@ -329,22 +328,22 @@ def main():
if master_password: if master_password:
chm.append("MASTER_PASSWORD=%(master_password)s") chm.append("MASTER_PASSWORD=%(master_password)s")
chm_params['master_password'] = master_password chm_params['master_password'] = master_password
if master_port: if master_port is not None:
chm.append("MASTER_PORT=%(master_port)s") chm.append("MASTER_PORT=%(master_port)s")
chm_params['master_port'] = master_port 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.append("MASTER_CONNECT_RETRY=%(master_connect_retry)s")
chm_params['master_connect_retry'] = master_connect_retry chm_params['master_connect_retry'] = master_connect_retry
if master_log_file: if master_log_file:
chm.append("MASTER_LOG_FILE=%(master_log_file)s") chm.append("MASTER_LOG_FILE=%(master_log_file)s")
chm_params['master_log_file'] = master_log_file 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.append("MASTER_LOG_POS=%(master_log_pos)s")
chm_params['master_log_pos'] = master_log_pos chm_params['master_log_pos'] = master_log_pos
if relay_log_file: if relay_log_file:
chm.append("RELAY_LOG_FILE=%(relay_log_file)s") chm.append("RELAY_LOG_FILE=%(relay_log_file)s")
chm_params['relay_log_file'] = relay_log_file 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.append("RELAY_LOG_POS=%(relay_log_pos)s")
chm_params['relay_log_pos'] = relay_log_pos chm_params['relay_log_pos'] = relay_log_pos
if master_ssl: if master_ssl:

Loading…
Cancel
Save