forked from p15670423/monkey
Adjusted island to parse changed host info
This commit is contained in:
parent
1ebbb83629
commit
f792572079
|
@ -22,18 +22,14 @@ class Bootloader(flask_restful.Resource):
|
||||||
|
|
||||||
# Used by monkey. can't secure.
|
# Used by monkey. can't secure.
|
||||||
def post(self, **kw):
|
def post(self, **kw):
|
||||||
data = json.loads(request.data.decode().replace("\n", ""))
|
data = json.loads(request.data.decode().replace("\n", "").replace("NAME=\"", "").replace("\"\"", "\""))
|
||||||
|
|
||||||
# Remove local ips
|
# Remove local ips
|
||||||
local_addr = [i for i in data["ips"] if i.startswith("127")]
|
local_addr = [i for i in data["ips"] if i.startswith("127")]
|
||||||
if local_addr:
|
if local_addr:
|
||||||
data["ips"].remove(local_addr[0])
|
data["ips"].remove(local_addr[0])
|
||||||
|
|
||||||
# Clean up os info
|
|
||||||
data['os_version'] = data['os_version'].split(" ")[0]
|
|
||||||
|
|
||||||
mongo.db.bootloader_telems.insert(data)
|
mongo.db.bootloader_telems.insert(data)
|
||||||
node_id = NodeService.get_or_create_node_from_bootloader_telem(data)
|
node_id = NodeService.get_or_create_node_from_bootloader_telem(data)
|
||||||
|
|
||||||
|
|
||||||
return make_response({"status": "OK"}, 200)
|
return make_response({"status": "OK"}, 200)
|
||||||
|
|
Loading…
Reference in New Issue