Commit a6f398ce authored by David Trattnig's avatar David Trattnig
Browse files

Moved Redis to CLI module.

parent 65cafc22
......@@ -83,7 +83,7 @@ class AuraEngine:
from modules.scheduling.scheduler import AuraScheduler
from modules.core.engine import SoundSystem
from modules.communication.redis.adapter import ServerRedisAdapter
from modules.cli.redis.adapter import ServerRedisAdapter
# If Liquidsoap should be started automatically
self.lqs_startup = lqs_startup
......@@ -116,12 +116,6 @@ class AuraEngine:
else:
self.logger.info(SimpleUtil.yellow("Please note, Liquidsoap needs to be started manually."))
# from modules.communication.redis.adapter import ServerRedisAdapter
# self.messenger = ServerRedisAdapter(self.config)
# self.messenger.scheduler = self.scheduler
# self.messenger.soundsystem = self.soundsystem
# self.messenger.start()
def start_lqs(self, debug_output, verbose_output):
"""
......
......@@ -21,8 +21,8 @@ import json
from modules.base.enum import RedisChannel
from modules.base.utils import TerminalColors
from modules.communication.redis.adapter import ClientRedisAdapter, ServerRedisAdapter
from modules.communication.redis.messenger import RedisMessenger
from modules.cli.redis.adapter import ClientRedisAdapter, ServerRedisAdapter
from modules.cli.redis.messenger import RedisMessenger
from modules.database.model import AuraDatabaseModel
......@@ -312,7 +312,7 @@ class Padavan:
# ------------------------------------------------------------------------------------------ #
def set_next_file(self, type, file):
#from modules.communication.redis.messenger import RedisMessenger
#from modules.cli.redis.messenger import RedisMessenger
#redis = RedisMessenger()
#redis.set_next_file_for(type, file)
......
......@@ -27,8 +27,8 @@ import threading
import redis
from modules.communication.redis.messenger import RedisMessenger
from modules.communication.redis.statestore import RedisStateStore
from modules.cli.redis.messenger import RedisMessenger
from modules.cli.redis.statestore import RedisStateStore
# from modules.communication.connection_tester import ConnectionTester
from modules.base.exceptions import RedisConnectionException
from modules.base.enum import RedisChannel
......
......@@ -21,7 +21,7 @@
import logging
from modules.communication.redis.statestore import RedisStateStore
from modules.cli.redis.statestore import RedisStateStore
from modules.base.enum import RedisChannel
......
......@@ -28,7 +28,7 @@ from enum import Enum
from socket import socket, AF_INET, SOCK_DGRAM, SOL_SOCKET, SO_BROADCAST
import meta
from modules.communication.redis.adapter import ClientRedisAdapter
from modules.cli.redis.adapter import ClientRedisAdapter
from modules.base.utils import SimpleUtil as SU
from modules.base.mail import AuraMailer
......@@ -91,7 +91,7 @@ class AuraMonitor:
# Register as an engine plugin
self.soundsystem.plugins["monitor"] = self
# Heartbeat settings
self.heartbeat_running = False
self.heartbeat_server = config.get("heartbeat_server")
......@@ -132,7 +132,6 @@ class AuraMonitor:
return self.status
def has_valid_status(self, update_vitality_only):
"""
Checks if the current status is valid to run engine. By default it
......@@ -200,7 +199,6 @@ class AuraMonitor:
self.update_vitality_status()
def update_vitality_status(self):
"""
Refreshes the vital status info which are required for the engine to survive.
......@@ -219,7 +217,6 @@ class AuraMonitor:
self.heartbeat()
def heartbeat(self):
"""
Every `heartbeat_frequency` seconds the current vitality status is checked. If it's okay,
......@@ -249,7 +246,6 @@ class AuraMonitor:
threading.Timer(self.config.get("heartbeat_frequency"), self.heartbeat).start()
def get_io_state(self):
"""
Retrieves all input and outputs provided by the engine.
......@@ -265,7 +261,6 @@ class AuraMonitor:
return MonitorResponseCode.INVALID_STATE.value
def validate_url_connection(self, url):
"""
Checks if connection to passed URL is successful.
......@@ -280,7 +275,6 @@ class AuraMonitor:
return True
def validate_redis_connection(self):
"""
Checks if the connection to Redis is successful.
......@@ -294,7 +288,6 @@ class AuraMonitor:
return True
def validate_directory(self, dir_path):
"""
Checks if a given directory is existing and holds content
......@@ -309,7 +302,6 @@ class AuraMonitor:
return status
def get_url_response(self, url):
"""
Fetches JSON data from the given URL.
......@@ -333,7 +325,6 @@ class AuraMonitor:
return MonitorResponseCode.INVALID_STATE.value
def get_engine_id(self):
"""
Retrieves a String identifier consisting of IP and Hostname to differentiate
......@@ -343,7 +334,6 @@ class AuraMonitor:
return "%s (%s)" % (self.get_ip(), host)
def get_ip(self):
"""
Returns the IP of the Engine instance.
......
......@@ -34,7 +34,7 @@ from modules.database.model import AuraDatabaseModel, Schedule, Playlist, Playli
from modules.base.exceptions import NoActiveScheduleException, NoActiveEntryException, LoadSourceException
from modules.base.enum import Channel, ChannelType, TimerType, TransitionType, EntryQueueState, EntryPlayState
from modules.base.utils import SimpleUtil, TerminalColors, EngineUtil
from modules.communication.redis.messenger import RedisMessenger
from modules.cli.redis.messenger import RedisMessenger
from modules.scheduling.calendar import AuraCalendarService
from modules.scheduling.fallback_manager import FallbackManager
......
......@@ -20,7 +20,6 @@
import urllib
import logging
import json
from modules.core.engine import SoundSystem
......@@ -59,7 +58,7 @@ class ConnectionTester(AuraConfig):
# ------------------------------------------------------------------------------------------ #
def test_lqs_conn(self):
try:
lsc = soundsystem(self.config)
lsc = SoundSystem(self.config)
lsc.mixer_status()
return True
......@@ -69,7 +68,7 @@ class ConnectionTester(AuraConfig):
# ------------------------------------------------------------------------------------------ #
def test_lqsr_conn(self):
try:
lsc = soundsystem(self.config)
lsc = SoundSystem(self.config)
lsc.get_recorder_status()
return True
......@@ -87,7 +86,7 @@ class ConnectionTester(AuraConfig):
# ------------------------------------------------------------------------------------------ #
def test_redis_conn(self):
from modules.communication.redis.adapter import ClientRedisAdapter
from modules.cli.redis.adapter import ClientRedisAdapter
try:
cra = ClientRedisAdapter()
cra.publish("aura", "status")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment