-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauto_trace.py
More file actions
37 lines (23 loc) · 826 Bytes
/
auto_trace.py
File metadata and controls
37 lines (23 loc) · 826 Bytes
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
37
#!/usr/local/bin/python3
import imp
import os
import subprocess
import itertools
try:
passive_nodes = []
possible_nodes = []
firstRound = True
while (firstRound or len(possible_nodes)):
# Checking new nodes
nodes = str(subprocess.check_output(['epmd', '-names'])).replace('\\','*')
result_list = list(map(lambda x: (x.split(' ')[1:2]), nodes.split('*')[1:]))
results = list(itertools.chain(*result_list))
ls_nodes = []
for result in results:
if result.startswith("erlang_ls") and not result in passive_nodes:
ls_nodes.append(result)
possible_nodes = ls_nodes
possible_nodes = filtered
while(possible_nodes.length)
except subprocess.CalledProcessError as err:
print(err)