From 416cef7a2bff1c42f55ccf524ac48e3be2601d7a Mon Sep 17 00:00:00 2001 From: alok Date: Mon, 18 Jun 2018 21:14:14 -0700 Subject: [PATCH] branch to consutruct 1 node per instance --- aws-scripts/preprocess_peerlist.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 aws-scripts/preprocess_peerlist.py diff --git a/aws-scripts/preprocess_peerlist.py b/aws-scripts/preprocess_peerlist.py new file mode 100644 index 000000000..faecebf07 --- /dev/null +++ b/aws-scripts/preprocess_peerlist.py @@ -0,0 +1,19 @@ +from collections import namedtuple +import requests +amazon_ipv4_url = "http://169.254.169.254/latest/meta-data/public-ipv4" +if __name__ == "__main__": + current_ip = requests.get(amazon_ipv4_url).text + f = open("all_peerlist.txt",r) + for myline in f: + mylist = myline.strip().split(" ") + ip = mylist[0] + if ip != current_ip: + peerList.append(myline) + f.close() + g = open("global_peerlist.txt") + for myline peerList: + g.write(myline + "\n") + g.close() + + + \ No newline at end of file