mirror of
https://github.com/ansible/awx.git
synced 2026-05-14 04:47:44 -02: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:
@@ -4,6 +4,7 @@ import logging
|
|||||||
import asyncio
|
import asyncio
|
||||||
import datetime
|
import datetime
|
||||||
import re
|
import re
|
||||||
|
import redis
|
||||||
from datetime import datetime as dt
|
from datetime import datetime as dt
|
||||||
|
|
||||||
from django.core.management.base import BaseCommand
|
from django.core.management.base import BaseCommand
|
||||||
@@ -91,7 +92,12 @@ class Command(BaseCommand):
|
|||||||
|
|
||||||
def handle(self, *arg, **options):
|
def handle(self, *arg, **options):
|
||||||
if options.get('status'):
|
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 = {}
|
data = {}
|
||||||
for family in stats_all:
|
for family in stats_all:
|
||||||
if family.type == 'gauge' and len(family.samples) > 1:
|
if family.type == 'gauge' and len(family.samples) > 1:
|
||||||
|
|||||||
Reference in New Issue
Block a user