| Total Complexity | 1 |
| Total Lines | 26 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 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 |