pglift-cli 2.2.0__tar.gz → 2.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/PKG-INFO +1 -1
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/src/pglift_cli/pghba.py +7 -4
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/tests/expect/test-cli-walkthrough.t +9 -9
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/.gitignore +0 -0
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/README.md +0 -0
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/hatch.toml +0 -0
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/pyproject.toml +0 -0
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/pytest.ini +0 -0
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/src/pglift_cli/__init__.py +0 -0
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/src/pglift_cli/__main__.py +0 -0
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/src/pglift_cli/_settings.py +0 -0
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/src/pglift_cli/_site.py +0 -0
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/src/pglift_cli/base.py +0 -0
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/src/pglift_cli/console.py +0 -0
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/src/pglift_cli/database.py +0 -0
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/src/pglift_cli/hookspecs.py +0 -0
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/src/pglift_cli/instance.py +0 -0
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/src/pglift_cli/main.py +0 -0
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/src/pglift_cli/model.py +0 -0
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/src/pglift_cli/patroni.py +0 -0
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/src/pglift_cli/pgbackrest/__init__.py +0 -0
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/src/pglift_cli/pgbackrest/repo_path.py +0 -0
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/src/pglift_cli/pgconf.py +0 -0
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/src/pglift_cli/pm.py +0 -0
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/src/pglift_cli/postgres.py +0 -0
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/src/pglift_cli/prometheus.py +0 -0
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/src/pglift_cli/py.typed +0 -0
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/src/pglift_cli/role.py +0 -0
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/src/pglift_cli/util.py +0 -0
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/tests/expect/.gitignore +0 -0
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/tests/expect/test-base.t +0 -0
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/tests/expect/test-demote.t +0 -0
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/tests/expect/test-help.t +0 -0
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/tests/expect/test-port-validation.t +0 -0
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/tests/expect/test-prometheus.t +0 -0
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/tests/expect/test-standby-pgbackrest.t +0 -0
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/tests/expect/test-transactions.t +0 -0
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/tests/expect/test-upgrade.t +0 -0
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/tests/unit/__init__.py +0 -0
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/tests/unit/conftest.py +0 -0
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/tests/unit/test__site.py +0 -0
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/tests/unit/test_audit.py +0 -0
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/tests/unit/test_cli.py +0 -0
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/tests/unit/test_main.py +0 -0
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/tests/unit/test_model.py +0 -0
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/tests/unit/test_pm.py +0 -0
- {pglift_cli-2.2.0 → pglift_cli-2.3.0}/tests/unit/test_util.py +0 -0
|
@@ -16,6 +16,7 @@ from .console import console
|
|
|
16
16
|
from .util import (
|
|
17
17
|
Group,
|
|
18
18
|
Obj,
|
|
19
|
+
async_command,
|
|
19
20
|
audit,
|
|
20
21
|
diff_options,
|
|
21
22
|
dry_run_option,
|
|
@@ -38,7 +39,8 @@ def cli(**kwargs: Any) -> None:
|
|
|
38
39
|
@diff_options["unified"]
|
|
39
40
|
@diff_options["ansible"]
|
|
40
41
|
@click.pass_obj
|
|
41
|
-
|
|
42
|
+
@async_command
|
|
43
|
+
async def add(
|
|
42
44
|
obj: Obj,
|
|
43
45
|
instance: PostgreSQLInstance,
|
|
44
46
|
hbarecord: interface.HbaRecord,
|
|
@@ -56,7 +58,7 @@ def add(
|
|
|
56
58
|
system_configure(dry_run=dry_run),
|
|
57
59
|
manager.from_instance(instance),
|
|
58
60
|
):
|
|
59
|
-
hba.add(instance, hbarecord)
|
|
61
|
+
await hba.add(instance, hbarecord)
|
|
60
62
|
if (diffvalue := diff.get()) is not None:
|
|
61
63
|
for diffitem in diffvalue:
|
|
62
64
|
console.print(diffitem)
|
|
@@ -69,7 +71,8 @@ def add(
|
|
|
69
71
|
@diff_options["unified"]
|
|
70
72
|
@diff_options["ansible"]
|
|
71
73
|
@click.pass_obj
|
|
72
|
-
|
|
74
|
+
@async_command
|
|
75
|
+
async def remove(
|
|
73
76
|
obj: Obj,
|
|
74
77
|
instance: PostgreSQLInstance,
|
|
75
78
|
hbarecord: interface.HbaRecord,
|
|
@@ -87,7 +90,7 @@ def remove(
|
|
|
87
90
|
system_configure(dry_run=dry_run),
|
|
88
91
|
manager.from_instance(instance),
|
|
89
92
|
):
|
|
90
|
-
hba.remove(instance, hbarecord)
|
|
93
|
+
await hba.remove(instance, hbarecord)
|
|
91
94
|
if (diffvalue := diff.get()) is not None:
|
|
92
95
|
for diffitem in diffvalue:
|
|
93
96
|
console.print(diffitem)
|
|
@@ -250,8 +250,8 @@ Stop, alter, (re)start an instance:
|
|
|
250
250
|
--- $TMPDIR/etc/prometheus/postgres_exporter-1*-main.conf (glob)
|
|
251
251
|
+++ $TMPDIR/etc/prometheus/postgres_exporter-1*-main.conf (glob)
|
|
252
252
|
@@ -1,2 +1,2 @@
|
|
253
|
-
DATA_SOURCE_NAME=postgresql://prometheus@:*/postgres?host
|
|
254
|
-
|
|
253
|
+
DATA_SOURCE_NAME=postgresql://prometheus@:*/postgres?host=* (glob)
|
|
254
|
+
*%2Fpostgresql&sslmode=disable (glob)
|
|
255
255
|
-POSTGRES_EXPORTER_OPTS='--web.listen-address :\d+ --log.level info' (re)
|
|
256
256
|
\+POSTGRES_EXPORTER_OPTS='--web.listen-address :\d+ --log.level info' (re)
|
|
257
257
|
--- /dev/null
|
|
@@ -294,7 +294,7 @@ Stop, alter, (re)start an instance:
|
|
|
294
294
|
INFO reloading PostgreSQL configuration for 1\d\/main (re)
|
|
295
295
|
INFO starting Prometheus postgres_exporter 1\d-main (re)
|
|
296
296
|
INFO creating role 'arole'
|
|
297
|
-
INFO
|
|
297
|
+
INFO HBA configuration updated
|
|
298
298
|
INFO reloading PostgreSQL configuration for 1\d\/main (re)
|
|
299
299
|
--- $TMPDIR/srv/pgsql/1*/main/data/postgresql.conf (glob)
|
|
300
300
|
+++ $TMPDIR/srv/pgsql/1*/main/data/postgresql.conf (glob)
|
|
@@ -391,7 +391,7 @@ PostgreSQL configuration
|
|
|
391
391
|
port: \d+ -> 1234 (re)
|
|
392
392
|
DRY RUN: no changes made
|
|
393
393
|
|
|
394
|
-
|
|
394
|
+
HBA configuration management:
|
|
395
395
|
|
|
396
396
|
$ pglift pghba add --user bob --method trust
|
|
397
397
|
INFO entry added to HBA configuration
|
|
@@ -583,7 +583,7 @@ Add and manipulate roles:
|
|
|
583
583
|
> EOF
|
|
584
584
|
$ pglift role apply -f $TMPDIR/role.yaml --dry-run
|
|
585
585
|
INFO creating role 'test'
|
|
586
|
-
INFO
|
|
586
|
+
INFO HBA configuration updated
|
|
587
587
|
INFO reloading PostgreSQL configuration for 1\d\/main (re)
|
|
588
588
|
DRY RUN: no changes made
|
|
589
589
|
$ grep 'test' $TMPDIR/srv/pgsql/${version}/main/data/pg_hba.conf
|
|
@@ -593,7 +593,7 @@ Add and manipulate roles:
|
|
|
593
593
|
[1]
|
|
594
594
|
$ pglift role apply -f $TMPDIR/role.yaml --diff
|
|
595
595
|
INFO creating role 'test'
|
|
596
|
-
INFO
|
|
596
|
+
INFO HBA configuration updated
|
|
597
597
|
INFO reloading PostgreSQL configuration for 1\d\/main (re)
|
|
598
598
|
--- $TMPDIR/srv/pgsql/1*/main/data/pg_hba.conf (glob)
|
|
599
599
|
+++ $TMPDIR/srv/pgsql/1*/main/data/pg_hba.conf (glob)
|
|
@@ -1102,7 +1102,7 @@ Databases
|
|
|
1102
1102
|
|
|
1103
1103
|
$ pglift role drop test --dry-run
|
|
1104
1104
|
INFO dropping role 'test'
|
|
1105
|
-
INFO removing entries from
|
|
1105
|
+
INFO removing entries from HBA configuration
|
|
1106
1106
|
DRY RUN: no changes made
|
|
1107
1107
|
$ pglift role drop test
|
|
1108
1108
|
INFO dropping role 'test'
|
|
@@ -1117,11 +1117,11 @@ Databases
|
|
|
1117
1117
|
[2]
|
|
1118
1118
|
$ pglift role drop test --drop-owned --dry-run
|
|
1119
1119
|
INFO dropping role 'test'
|
|
1120
|
-
INFO removing entries from
|
|
1120
|
+
INFO removing entries from HBA configuration
|
|
1121
1121
|
DRY RUN: no changes made
|
|
1122
1122
|
$ pglift role drop test --drop-owned
|
|
1123
1123
|
INFO dropping role 'test'
|
|
1124
|
-
INFO removing entries from
|
|
1124
|
+
INFO removing entries from HBA configuration
|
|
1125
1125
|
|
|
1126
1126
|
Profiles
|
|
1127
1127
|
$ pglift role -i main create dba1 --password mySup3rS3cr3t1377 --login
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|