Implement API for authentication management actions
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import main
|
||||
from modules import chankeep
|
||||
from utils.logging.debug import debug
|
||||
|
||||
# from utils.logging.debug import debug
|
||||
|
||||
|
||||
def get_first_relay(net):
|
||||
@@ -53,3 +54,19 @@ def get_active_relays(net):
|
||||
if name in main.IRCPool.keys():
|
||||
active_insts.append(main.IRCPool[name])
|
||||
return active_insts
|
||||
|
||||
|
||||
def get_connected_relays(net):
|
||||
"""
|
||||
Get all connected instances for the network.
|
||||
:param net: the network
|
||||
:return: list of active instances
|
||||
:rtype: list of IRCPool instances
|
||||
"""
|
||||
active_nums = chankeep.getConnectedRelays(net)
|
||||
active_insts = []
|
||||
for num in active_nums:
|
||||
name = net + str(num)
|
||||
if name in main.IRCPool.keys():
|
||||
active_insts.append(main.IRCPool[name])
|
||||
return active_insts
|
||||
|
||||
Reference in New Issue
Block a user