Skip to content

Commit a39b446

Browse files
committed
format
1 parent c1feb69 commit a39b446

File tree

4 files changed

+29
-29
lines changed

4 files changed

+29
-29
lines changed

src/charm.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@
7171
MONITORING_USER,
7272
PATRONI_CONF_PATH,
7373
PEER,
74-
UPGRADE_RELATION,
7574
POSTGRESQL_SNAP_NAME,
7675
REPLICATION_PASSWORD_KEY,
7776
REWIND_PASSWORD_KEY,
@@ -84,6 +83,7 @@
8483
TLS_CERT_FILE,
8584
TLS_KEY_FILE,
8685
UNIT_SCOPE,
86+
UPGRADE_RELATION,
8787
USER,
8888
USER_PASSWORD_KEY,
8989
)
@@ -96,9 +96,7 @@
9696

9797
PRIMARY_NOT_REACHABLE_MESSAGE = "waiting for primary to be reachable from this unit"
9898
EXTENSIONS_DEPENDENCY_MESSAGE = "Unsatisfied plugin dependencies. Please check the logs"
99-
DIFFERENT_VERSIONS_PSQL_BLOCKING_MESSAGE = (
100-
"Please select the correct version of postgresql to use. You cannot use different versions of postgresql!"
101-
)
99+
DIFFERENT_VERSIONS_PSQL_BLOCKING_MESSAGE = "Please select the correct version of postgresql to use. You cannot use different versions of postgresql!"
102100

103101
Scopes = Literal[APP_SCOPE, UNIT_SCOPE]
104102

@@ -160,7 +158,9 @@ def __init__(self, *args):
160158
self.framework.observe(self.on.config_changed, self._on_config_changed)
161159
self.framework.observe(self.on.get_primary_action, self._on_get_primary)
162160
self.framework.observe(self.on[PEER].relation_changed, self._on_peer_relation_changed)
163-
self.framework.observe(self.on[UPGRADE_RELATION].relation_changed, self._on_upgrade_relation_changed)
161+
self.framework.observe(
162+
self.on[UPGRADE_RELATION].relation_changed, self._on_upgrade_relation_changed
163+
)
164164
self.framework.observe(self.on.secret_changed, self._on_peer_relation_changed)
165165
self.framework.observe(self.on.secret_remove, self._on_peer_relation_changed)
166166
self.framework.observe(self.on[PEER].relation_departed, self._on_peer_relation_departed)

tests/integration/ha_tests/helpers.py

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -875,15 +875,15 @@ async def reused_full_cluster_recovery_storage(ops_test: OpsTest, unit_name) ->
875875
async def get_db_connection(ops_test, dbname, is_primary=True, replica_unit_name=""):
876876
"""Returns a PostgreSQL connection string.
877877
878-
Args:
879-
ops_test: The ops test framework instance
880-
dbname: The name of the database
881-
is_primary: Whether to use a primary unit (default is True, so it uses the primary
882-
replica_unit_name: The name of the replica unit
883-
884-
Returns:
885-
a PostgreSQL connection string
886-
"""
878+
Args:
879+
ops_test: The ops test framework instance
880+
dbname: The name of the database
881+
is_primary: Whether to use a primary unit (default is True, so it uses the primary
882+
replica_unit_name: The name of the replica unit
883+
884+
Returns:
885+
a PostgreSQL connection string
886+
"""
887887
unit_name = await get_primary(ops_test, APP_NAME)
888888
password = await get_password(ops_test, APP_NAME)
889889
address = get_unit_address(ops_test, unit_name)
@@ -900,9 +900,9 @@ async def get_db_connection(ops_test, dbname, is_primary=True, replica_unit_name
900900
async def validate_test_data(connection_string):
901901
"""Checking test data.
902902
903-
Args:
904-
connection_string: Database connection string
905-
"""
903+
Args:
904+
connection_string: Database connection string
905+
"""
906906
with psycopg2.connect(connection_string) as connection:
907907
connection.autocommit = True
908908
with connection.cursor() as cursor:
@@ -915,9 +915,9 @@ async def validate_test_data(connection_string):
915915
async def create_test_data(connection_string):
916916
"""Creating test data in the database.
917917
918-
Args:
919-
connection_string: Database connection string
920-
"""
918+
Args:
919+
connection_string: Database connection string
920+
"""
921921
with psycopg2.connect(connection_string) as connection:
922922
connection.autocommit = True
923923
with connection.cursor() as cursor:
@@ -935,14 +935,14 @@ async def create_test_data(connection_string):
935935
async def get_last_added_unit(ops_test, app, prev_units):
936936
"""Returns a unit.
937937
938-
Args:
939-
ops_test: The ops test framework instance
940-
app: The name of the application
941-
prev_units: List of unit names before adding the last unit
938+
Args:
939+
ops_test: The ops test framework instance
940+
app: The name of the application
941+
prev_units: List of unit names before adding the last unit
942942
943-
Returns:
944-
last added unit
945-
"""
943+
Returns:
944+
last added unit
945+
"""
946946
curr_units = [unit.name for unit in ops_test.model.applications[app].units]
947947
new_unit = list(set(curr_units) - set(prev_units))[0]
948948
for unit in ops_test.model.applications[app].units:

tests/integration/ha_tests/test_restore_cluster.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
set_password,
1818
)
1919
from .helpers import (
20+
SECOND_APPLICATION,
2021
add_unit_with_storage,
2122
reused_full_cluster_recovery_storage,
2223
storage_id,
23-
SECOND_APPLICATION,
2424
)
2525

2626
FIRST_APPLICATION = "first-cluster"

tests/integration/ha_tests/test_self_healing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from .helpers import (
2323
METADATA,
2424
ORIGINAL_RESTART_CONDITION,
25+
SECOND_APPLICATION,
2526
add_unit_with_storage,
2627
app_name,
2728
are_all_db_processes_down,
@@ -56,7 +57,6 @@
5657
update_restart_condition,
5758
validate_test_data,
5859
wait_network_restore,
59-
SECOND_APPLICATION,
6060
)
6161

6262
logger = logging.getLogger(__name__)

0 commit comments

Comments
 (0)