backend.doflow_discover   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 17
dl 0
loc 26
rs 10
c 0
b 0
f 0
wmc 1

1 Function

Rating   Name   Duplication   Size   Complexity  
A main() 0 12 1
1
'''do the discovery workflow, but bypassing the queue'''
2
3
#do not remove! needed
4
import json #pylint: disable=unused-import
5
from helpers.networkhelper import networkmap
6
from backend.fcmapp import ApplicationService
7
from backend.doflow_handlemessages import dispatchmessages
8
from backend.when_discover import findminers
9
10
def main():
11
    mainapp = ApplicationService(component='discover', option='')
12
13
    mainapp.cache.purge()
14
15
    #this is the discovery process
16
    hosts_list = networkmap(mainapp.configuration.get('discover.dns'), \
17
        mainapp.configuration.get('discover.minerport'), \
18
        mainapp.configuration.get('discover.sshport'))
19
    discoveredentries = findminers(hosts_list, mainapp.knownminers())
20
    dispatchmessages(mainapp, discoveredentries)
21
    print('done')
22
23
24
if __name__ == "__main__":
25
    main()
26