Skip to content

Commit 00b0267

Browse files
author
András Váczi
committed
Revert UTC handling for now
1 parent 333eb3b commit 00b0267

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

patroni/ctl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1503,7 +1503,7 @@ def get_cluster_service_info(cluster: Dict[str, Any]) -> List[str]:
15031503
service_info: List[str] = []
15041504

15051505
if 'multisite' in cluster:
1506-
info = f"Multisite {cluster['multisite']['name'] or ''} is {cluster['multisite']['status'].lower()}"
1506+
info = f"Multisite {cluster['multisite'].get('name') or ''} is {cluster['multisite']['status'].lower()}"
15071507
standby_config = cluster['multisite'].get('standby_config', {})
15081508
if standby_config and standby_config.get('host'):
15091509
info += f", replicating from {standby_config['host']}:{standby_config.get('port', 5432)}"

patroni/multisite.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import time
55

66
from collections.abc import Callable
7-
from datetime import datetime, UTC
7+
from datetime import datetime
88
from threading import Event, Thread
99
from typing import Any, Dict, List, Optional, TYPE_CHECKING
1010

@@ -410,7 +410,7 @@ def __init__(self, crd_name: str, crd_uid: str, reporter: str, crd_api: str):
410410
def state_transition(self, new_state: str, note: str):
411411
self._status_update = {"status": {"Multisite": new_state}}
412412

413-
failover_time = datetime.now(UTC).strftime("%Y-%m-%dT%H:%M:%S.%fZ")
413+
failover_time = datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%S.%fZ")
414414
reason = 'Promote' if new_state == 'Leader' else 'Demote'
415415

416416
# TODO: check if this is needed, no current call comes without note (this is already reflected in the signature)

0 commit comments

Comments
 (0)