return the args for the command :param data: Data. :param manager: Manager. :param server: Server. :param filepath: File. :return: args list.
(data, manager, server, filepath)
| 375 | |
| 376 | |
| 377 | def get_sql_util_args(data, manager, server, filepath): |
| 378 | """ |
| 379 | return the args for the command |
| 380 | :param data: Data. |
| 381 | :param manager: Manager. |
| 382 | :param server: Server. |
| 383 | :param filepath: File. |
| 384 | :return: args list. |
| 385 | """ |
| 386 | restrict_key = secrets.token_hex(32) |
| 387 | host = manager.local_bind_host if manager.use_ssh_tunnel \ |
| 388 | else server.host |
| 389 | port = manager.local_bind_port if manager.use_ssh_tunnel \ |
| 390 | else server.port |
| 391 | args = [ |
| 392 | '--dbname', data['database'], |
| 393 | '-c', f'\\restrict {restrict_key}', |
| 394 | '--file', fs_short_path(filepath) |
| 395 | ] |
| 396 | if host: |
| 397 | args.extend(['--host', host]) |
| 398 | |
| 399 | if port: |
| 400 | args.extend(['--port', str(port)]) |
| 401 | |
| 402 | if server.username: |
| 403 | args.extend(['--username', server.username]) |
| 404 | |
| 405 | return args |
| 406 | |
| 407 | |
| 408 | def use_restore_utility(data, manager, server, driver, conn, filepath): |
no test coverage detected