fix bug where port becomes truthy when none is converted to str
This commit is contained in:
parent
82d851d891
commit
8389851f2f
3 changed files with 3 additions and 3 deletions
|
@ -143,7 +143,7 @@ def build_restore_command(extract_process, database, dump_filename, connection_p
|
|||
Return the mongorestore command from a single database configuration.
|
||||
'''
|
||||
hostname = connection_params['hostname'] or database.get('restore_hostname', database.get('hostname'))
|
||||
port = str(connection_params['port'] or database.get('restore_port', database.get('port')))
|
||||
port = str(connection_params['port'] or database.get('restore_port', database.get('port', '')))
|
||||
username = connection_params['username'] or database.get('restore_username', database.get('username'))
|
||||
password = connection_params['password'] or database.get('restore_password', database.get('password'))
|
||||
|
||||
|
|
|
@ -201,7 +201,7 @@ def restore_database_dump(database_config, log_prefix, location_config, dry_run,
|
|||
database = database_config[0]
|
||||
|
||||
hostname = connection_params['hostname'] or database.get('restore_hostname', database.get('hostname'))
|
||||
port = str(connection_params['port'] or database.get('restore_port', database.get('port')))
|
||||
port = str(connection_params['port'] or database.get('restore_port', database.get('port', '')))
|
||||
username = connection_params['username'] or database.get('restore_username', database.get('username'))
|
||||
password = connection_params['password'] or database.get('restore_password', database.get('password'))
|
||||
|
||||
|
|
|
@ -222,7 +222,7 @@ def restore_database_dump(database_config, log_prefix, location_config, dry_run,
|
|||
database = database_config[0]
|
||||
|
||||
hostname = connection_params['hostname'] or database.get('restore_hostname', database.get('hostname'))
|
||||
port = str(connection_params['port'] or database.get('restore_port', database.get('port')))
|
||||
port = str(connection_params['port'] or database.get('restore_port', database.get('port', '')))
|
||||
username = connection_params['username'] or database.get('restore_username', database.get('username'))
|
||||
|
||||
all_databases = bool(database['name'] == 'all')
|
||||
|
|
Loading…
Reference in a new issue