(self)
| 599 | return bpath |
| 600 | |
| 601 | def _get_pg_version(self): |
| 602 | process = subprocess.run( |
| 603 | [self._postgres, '--version'], |
| 604 | stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
| 605 | stdout, stderr = process.stdout, process.stderr |
| 606 | |
| 607 | if process.returncode != 0: |
| 608 | raise ClusterError( |
| 609 | 'postgres --version exited with status {:d}: {}'.format( |
| 610 | process.returncode, stderr)) |
| 611 | |
| 612 | version_string = stdout.decode('utf-8').strip(' \n') |
| 613 | prefix = 'postgres (PostgreSQL) ' |
| 614 | if not version_string.startswith(prefix): |
| 615 | raise ClusterError( |
| 616 | 'could not determine server version from {!r}'.format( |
| 617 | version_string)) |
| 618 | version_string = version_string[len(prefix):] |
| 619 | |
| 620 | return serverversion.split_server_version_string(version_string) |
| 621 | |
| 622 | |
| 623 | class TempCluster(Cluster): |
no test coverage detected