|
145 | 145 | anon_key = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImFhYWFhYWFhYWFhYWFhYWFhYWFhIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTYyMjQ5NjYsImV4cCI6MjAxMTgwMDk2Nn0.QW95aRPA-4QuLzuvaIeeoFKlJP9J2hvAIpJ3WJ6G5zo" |
146 | 146 | service_role_key = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImFhYWFhYWFhYWFhYWFhYWFhYWFhIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImlhdCI6MTY5NjIyNDk2NiwiZXhwIjoyMDExODAwOTY2fQ.Om7yqv15gC3mLGitBmvFRB3M4IsLsX9fXzTQnFM7lu0" |
147 | 147 | supabase_admin_key = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImFhYWFhYWFhYWFhYWFhYWFhYWFhIiwicm9sZSI6InN1cGFiYXNlX2FkbWluIiwiaWF0IjoxNjk2MjI0OTY2LCJleHAiOjIwMTE4MDA5NjZ9.jrD3j2rBWiIx0vhVZzd1CXFv7qkAP392nBMadvXxk1c" |
| 148 | + |
| 149 | + |
| 150 | +def load_expected_pgbouncer_version() -> str: |
| 151 | + repo_root = Path(__file__).resolve().parent.parent |
| 152 | + ansible_vars = repo_root / "ansible" / "vars.yml" |
| 153 | + if ansible_vars.exists(): |
| 154 | + with ansible_vars.open() as f: |
| 155 | + for raw_line in f: |
| 156 | + line = raw_line.strip() |
| 157 | + if line.startswith("pgbouncer_release:"): |
| 158 | + return line.split(":", 1)[1].strip().strip('"') |
| 159 | + |
| 160 | + nix_file = repo_root / "nix" / "pgbouncer.nix" |
| 161 | + if nix_file.exists(): |
| 162 | + with nix_file.open() as f: |
| 163 | + for raw_line in f: |
| 164 | + line = raw_line.strip() |
| 165 | + if line.startswith("version ="): |
| 166 | + value = line.split("=", 1)[1].strip() |
| 167 | + return value.strip(";").strip('"') |
| 168 | + |
| 169 | + raise RuntimeError( |
| 170 | + "Could not determine expected PgBouncer version from configuration files" |
| 171 | + ) |
| 172 | + |
| 173 | + |
| 174 | +EXPECTED_PGBOUNCER_VERSION = load_expected_pgbouncer_version() |
| 175 | +PGBOUNCER_BINARY = "/nix/var/nix/profiles/per-user/pgbouncer/profile/bin/pgbouncer" |
148 | 176 | init_json_content = f""" |
149 | 177 | {{ |
150 | 178 | "jwt_secret": "my_jwt_secret_which_is_not_so_secret", |
@@ -200,7 +228,7 @@ def get_ssh_connection(instance_ip, ssh_identity_file, max_retries=10): |
200 | 228 | else: |
201 | 229 | raise Exception("SSH test command failed") |
202 | 230 |
|
203 | | - except Exception as e: |
| 231 | + except Exception: |
204 | 232 | if attempt == max_retries - 1: |
205 | 233 | raise |
206 | 234 | logger.warning( |
|
0 commit comments