diff --git a/awx/main/management/commands/run_wsbroadcast.py b/awx/main/management/commands/run_wsbroadcast.py index 2e60d945e8..62f571921d 100644 --- a/awx/main/management/commands/run_wsbroadcast.py +++ b/awx/main/management/commands/run_wsbroadcast.py @@ -56,8 +56,8 @@ class Command(BaseCommand): host_stats = [('hostname', 'state', 'start time', 'duration (sec)')] for h in hostnames: connection_color = '91' # red - h = safe_name(h) - prefix = f'awx_{h}' + h_safe = safe_name(h) + prefix = f'awx_{h_safe}' connection_state = data.get(f'{prefix}_connection', 'N/A') connection_started = 'N/A' connection_duration = 'N/A' @@ -80,8 +80,8 @@ class Command(BaseCommand): def get_connection_stats(cls, me, hostnames, data): host_stats = [('hostname', 'total', 'per minute')] for h in hostnames: - h = safe_name(h) - prefix = f'awx_{h}' + h_safe = safe_name(h) + prefix = f'awx_{h_safe}' messages_total = data.get(f'{prefix}_messages_received', '0') messages_per_minute = data.get(f'{prefix}_messages_received_per_minute', '0')