mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-01-27 18:20:05 +00:00
* Use YAML files to validate Postgres GUCs through Patroni. Patroni used to have a static list of Postgres GUCs validators in `patroni.postgresql.validator`. One problem with that approach, for example, is that it would not allow GUCs from custom Postgres builds to be validated/accepted. The idea that we had to work around that issue was to move the validators from the source code to an external and extendable source. With that Patroni will start reading the current validators from that external source plus whatever custom validators are found. From this commit onwards Patroni will read and parse all YAML files that are found under the `patroni/postgresql/available_parameters` directory to build its Postgres GUCs validation rules. All the details about how this work can be found in the docstring of the introduced function `_load_postgres_gucs_validators`.
43 lines
1.0 KiB
Python
43 lines
1.0 KiB
Python
# -*- mode: python -*-
|
|
|
|
block_cipher = None
|
|
|
|
|
|
def hiddenimports():
|
|
import sys
|
|
sys.path.insert(0, '.')
|
|
try:
|
|
import patroni.dcs
|
|
return patroni.dcs.dcs_modules() + ['http.server']
|
|
finally:
|
|
sys.path.pop(0)
|
|
|
|
|
|
a = Analysis(['patroni/__main__.py'],
|
|
pathex=[],
|
|
binaries=None,
|
|
datas=[
|
|
('patroni/postgresql/available_parameters/*.yml', 'patroni/postgresql/available_parameters'),
|
|
('patroni/postgresql/available_parameters/*.yaml', 'patroni/postgresql/available_parameters'),
|
|
],
|
|
hiddenimports=hiddenimports(),
|
|
hookspath=[],
|
|
runtime_hooks=[],
|
|
excludes=[],
|
|
win_no_prefer_redirects=False,
|
|
win_private_assemblies=False,
|
|
cipher=block_cipher)
|
|
|
|
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
|
|
|
|
exe = EXE(pyz,
|
|
a.scripts,
|
|
a.binaries,
|
|
a.zipfiles,
|
|
a.datas,
|
|
name='patroni',
|
|
debug=False,
|
|
strip=False,
|
|
upx=True,
|
|
console=True)
|