From 48fb4fa7d0f7a0ed1a54a595e28d7324f2176738 Mon Sep 17 00:00:00 2001 From: zlianzhuang Date: Tue, 26 Sep 2023 14:17:35 +0000 Subject: [PATCH] reformat code --- .../postgres-operator/postgres/pgsqlclusters/timer.py | 1 + .../postgres-operator/postgres/pgsqlclusters/update.py | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/platforms/kubernetes/postgres-operator/postgres/pgsqlclusters/timer.py b/platforms/kubernetes/postgres-operator/postgres/pgsqlclusters/timer.py index 06e299f..ad01065 100644 --- a/platforms/kubernetes/postgres-operator/postgres/pgsqlclusters/timer.py +++ b/platforms/kubernetes/postgres-operator/postgres/pgsqlclusters/timer.py @@ -20,6 +20,7 @@ def current_time() -> str: return time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) + def timer_cluster( meta: kopf.Meta, spec: kopf.Spec, diff --git a/platforms/kubernetes/postgres-operator/postgres/pgsqlclusters/update.py b/platforms/kubernetes/postgres-operator/postgres/pgsqlclusters/update.py index f9e7e54..313a7e6 100644 --- a/platforms/kubernetes/postgres-operator/postgres/pgsqlclusters/update.py +++ b/platforms/kubernetes/postgres-operator/postgres/pgsqlclusters/update.py @@ -213,8 +213,9 @@ def update_action( spec, meta, patch, pgsql_util.get_field(POSTGRESQL, READONLYINSTANCE), False, None, logger, None, status, False) - if pgsql_util.in_disaster_backup(meta, spec, patch, status, logger) == True: - conns += [ readwrite_conns.get_conns()[0] ] + if pgsql_util.in_disaster_backup(meta, spec, patch, status, + logger) == True: + conns += [readwrite_conns.get_conns()[0]] else: conns += readwrite_conns.get_conns() conns += readonly_conns.get_conns() @@ -226,7 +227,8 @@ def update_action( pgsql_util.postgresql_action(meta, spec, patch, status, logger, conn, start) - if NEW == ACTION_START and pgsql_util.in_disaster_backup(meta, spec, patch, status, logger) == False: + if NEW == ACTION_START and pgsql_util.in_disaster_backup( + meta, spec, patch, status, logger) == False: pgsql_util.waiting_postgresql_ready(readwrite_conns, logger) pgsql_util.waiting_postgresql_ready(readonly_conns, logger) pgsql_util.waiting_cluster_final_status(