(*args, **kwargs)
| 87 | |
| 88 | @wraps(f) |
| 89 | def wrap(*args, **kwargs): |
| 90 | # Here args[0] will hold self & kwargs will hold sid,did |
| 91 | |
| 92 | server_info.clear() |
| 93 | server_info['manager'] = get_driver(PG_DEFAULT_DRIVER)\ |
| 94 | .connection_manager(kwargs['sid']) |
| 95 | server_info['conn'] = server_info['manager'].connection( |
| 96 | did=kwargs['did'] |
| 97 | ) |
| 98 | # If DB not connected then return error to browser |
| 99 | if not server_info['conn'].connected(): |
| 100 | return precondition_required( |
| 101 | gettext("Connection to the server has been lost.") |
| 102 | ) |
| 103 | |
| 104 | # Set template path for sql scripts |
| 105 | server_info['server_type'] = server_info['manager'].server_type |
| 106 | server_info['version'] = server_info['manager'].version |
| 107 | if server_info['server_type'] == 'pg': |
| 108 | server_info['template_path'] = 'grant_wizard/pg/#{0}#'.format( |
| 109 | server_info['version']) |
| 110 | elif server_info['server_type'] == 'ppas': |
| 111 | server_info['template_path'] = 'grant_wizard/ppas/#{0}#'.format( |
| 112 | server_info['version']) |
| 113 | |
| 114 | return f(*args, **kwargs) |
| 115 | |
| 116 | return wrap |
| 117 |
nothing calls this directly
no test coverage detected