MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / check_utility_exists

Function check_utility_exists

web/pgadmin/tools/backup/__init__.py:515–547  ·  view source on GitHub ↗

This function checks the utility file exist on the given path. Args: sid: Server ID backup_obj_type: Type of the object Returns: None

(sid, backup_obj_type)

Source from the content-addressed store, hash-verified

513)
514@pga_login_required
515def check_utility_exists(sid, backup_obj_type):
516 """
517 This function checks the utility file exist on the given path.
518
519 Args:
520 sid: Server ID
521 backup_obj_type: Type of the object
522 Returns:
523 None
524 """
525 server = get_server(sid)
526
527 if server is None:
528 return make_json_response(
529 success=0,
530 errormsg=SERVER_NOT_FOUND
531 )
532
533 from pgadmin.utils.driver import get_driver
534 driver = get_driver(PG_DEFAULT_DRIVER)
535 manager = driver.connection_manager(server.id)
536
537 utility = manager.utility('backup') if backup_obj_type == 'objects' \
538 else manager.utility('backup_server')
539
540 ret_val = does_utility_exist(utility)
541 if ret_val:
542 return make_json_response(
543 success=0,
544 errormsg=ret_val
545 )
546
547 return make_json_response(success=1)
548
549
550@blueprint.route(

Callers

nothing calls this directly

Calls 6

get_serverFunction · 0.90
make_json_responseFunction · 0.90
get_driverFunction · 0.90
does_utility_existFunction · 0.90
connection_managerMethod · 0.80
utilityMethod · 0.45

Tested by

no test coverage detected