-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfDebugging.py
36 lines (28 loc) · 1.47 KB
/
confDebugging.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from ligmos.utils import amq, classes, database, confparsers
from ligmos.workers import connSetup
# cfile = './alfred.conf'
# confclass = classes.hostTarget
# pfile = './passwords.conf'
cfile = './abu.conf'
confclass = classes.sneakyTarget
pfile = './passwords.conf'
# Parse the things!
config, comm = confparsers.parseConfig(cfile, confclass,
passfile=pfile,
searchCommon=True,
enableCheck=True,
debug=True)
# Check to see if there are any connections/objects to establish
amqlistener = amq.silentSubscriber()
# NOTE: The idea is that basically ALL of what follows will become completely
# generic boilerplate, to be shuffled away behind the scenes somewhere
# for much easier access. The only thing that might poke out is the stuff
# above, but even that can be hidden away if we really need/want to do that.
amqtopics = amq.getAllTopics(config, comm)
amqbrokers, influxdatabases = connSetup.connAMQ_IDB(comm,
amqtopics,
amqlistener=amqlistener)
# This part should be in whatever loop gets set up to continually run
# amqbroker sections containing the connection objects can change, so
# make sure that we get it back in case a change (reconnection) happened.
amqbrokers = amq.checkConnections(amqbrokers, subscribe=False)