Skip to content

Commit 2664b14

Browse files
[LDAP] Back-port charm lib fix
1 parent a99f0f5 commit 2664b14

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/charms/postgresql_k8s/v0/postgresql.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,7 @@ def list_access_groups(self) -> Set[str]:
626626
Returns:
627627
List of PostgreSQL database access groups.
628628
"""
629+
connection = None
629630
try:
630631
with self._connect_to_database() as connection, connection.cursor() as cursor:
631632
cursor.execute(
@@ -646,6 +647,7 @@ def list_users(self) -> Set[str]:
646647
Returns:
647648
List of PostgreSQL database users.
648649
"""
650+
connection = None
649651
try:
650652
with self._connect_to_database() as connection, connection.cursor() as cursor:
651653
cursor.execute("SELECT usename FROM pg_catalog.pg_user;")
@@ -664,6 +666,7 @@ def list_users_from_relation(self) -> Set[str]:
664666
Returns:
665667
List of PostgreSQL database users.
666668
"""
669+
connection = None
667670
try:
668671
with self._connect_to_database() as connection, connection.cursor() as cursor:
669672
cursor.execute(

0 commit comments

Comments
 (0)