fix empty password
This commit is contained in:
@ -15,9 +15,9 @@ class UpgradeParams:
|
||||
old_version = '4.0.0.0'
|
||||
|
||||
class PasswordMaskingFormatter(logging.Formatter):
|
||||
def format(self, record):
|
||||
s = super(PasswordMaskingFormatter, self).format(record)
|
||||
return re.sub(r'password=\".*?\"', 'password=\"******\"', s)
|
||||
def format(self, record):
|
||||
s = super(PasswordMaskingFormatter, self).format(record)
|
||||
return re.sub(r'password="(?:[^"\\]|\\.)+"', 'password="******"', s)
|
||||
|
||||
#### --------------start : my_error.py --------------
|
||||
class MyError(Exception):
|
||||
@ -804,7 +804,7 @@ if __name__ == '__main__':
|
||||
password = get_opt_password()
|
||||
timeout = int(get_opt_timeout())
|
||||
logging.info('parameters from cmd: host=\"%s\", port=%s, user=\"%s\", password=\"%s\", timeout=\"%s\", log-file=\"%s\"',\
|
||||
host, port, user, password, timeout, log_filename)
|
||||
host, port, user, password.replace('"', '\\"'), timeout, log_filename)
|
||||
do_check(host, port, user, password, timeout, upgrade_params)
|
||||
except mysql.connector.Error, e:
|
||||
logging.exception('mysql connctor error')
|
||||
|
||||
Reference in New Issue
Block a user