mirror of
https://github.com/ansible/awx.git
synced 2026-01-19 21:51:26 -03:30
nice error message when redis is down
* awx_manage run_wsbroadcast --status nice error message if someone failed to start awx services (i.e. redis)
This commit is contained in:
parent
63f56d33aa
commit
1acca459ef
@ -4,6 +4,7 @@ import logging
|
||||
import asyncio
|
||||
import datetime
|
||||
import re
|
||||
import redis
|
||||
from datetime import datetime as dt
|
||||
|
||||
from django.core.management.base import BaseCommand
|
||||
@ -91,7 +92,12 @@ class Command(BaseCommand):
|
||||
|
||||
def handle(self, *arg, **options):
|
||||
if options.get('status'):
|
||||
stats_all = BroadcastWebsocketStatsManager.get_stats_sync()
|
||||
try:
|
||||
stats_all = BroadcastWebsocketStatsManager.get_stats_sync()
|
||||
except redis.exceptions.ConnectionError as e:
|
||||
print(f"Unable to get Broadcast Websocket Status. Failed to connect to redis {e}")
|
||||
return
|
||||
|
||||
data = {}
|
||||
for family in stats_all:
|
||||
if family.type == 'gauge' and len(family.samples) > 1:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user