fix witten reported mysql error

This commit is contained in:
Divyansh Singh 2023-06-17 22:58:59 +05:30
parent 6c87608548
commit e53dd3da87

View file

@ -216,10 +216,10 @@ def restore_database_dump(
restore_command = ( restore_command = (
('mysql', '--batch') ('mysql', '--batch')
+ (tuple(database['restore_options'].split(' ')) if 'restore_options' in database else ()) + (tuple(database['restore_options'].split(' ')) if 'restore_options' in database else ())
+ (('--host', database['hostname']) if hostname else ()) + (('--host', hostname) if hostname else ())
+ (('--port', str(database['port'])) if port else ()) + (('--port', str(port)) if port else ())
+ (('--protocol', 'tcp') if hostname or port else ()) + (('--protocol', 'tcp') if hostname or port else ())
+ (('--user', database['username']) if username else ()) + (('--user', username) if username else ())
) )
extra_environment = {'MYSQL_PWD': password} if password else None extra_environment = {'MYSQL_PWD': password} if password else None