Skip to content

Commit 073110f

Browse files
[MISC] Add missing connection vars (#920)
1 parent bce4974 commit 073110f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/charms/postgresql_k8s/v0/postgresql.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
# Increment this PATCH version before using `charmcraft publish-lib` or reset
3737
# to 0 if you are raising the major API version
38-
LIBPATCH = 48
38+
LIBPATCH = 49
3939

4040
# Groups to distinguish HBA access
4141
ACCESS_GROUP_IDENTITY = "identity_access"
@@ -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)