(commands, project_id)
| 495 | text=True, |
| 496 | ) |
| 497 | def invoke_shell_command(commands, project_id): |
| 498 | try: |
| 499 | |
| 500 | return subprocess.run( |
| 501 | commands, |
| 502 | check=True, |
| 503 | capture_output=True, |
| 504 | text=True, |
| 505 | ) |
| 506 | except subprocess.CalledProcessError as e: |
| 507 | if "Enable it by visiting https://console.developers" in e.stderr: |
| 508 | enable_compute_services(project_id) |
| 509 | return invoke_shell_command(commands, project_id) |
| 510 | else: |
| 511 | raise e # Re-raise the exception for other errors |
| 512 | |
| 513 | |
| 514 |
no test coverage detected