diff --git a/.gitignore b/.gitignore index c1d1065..d7e52c2 100644 --- a/.gitignore +++ b/.gitignore @@ -103,11 +103,5 @@ pip-selfcheck.json *.retry *.swp -.retry -group_vars/vmware -*.ova -*.iso -*.vmdk -*.mf -*.ovf -.vscode \ No newline at end of file +.vscode +ui/config.yml \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 114c20f..22ffe58 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3 +FROM python:3-slim WORKDIR /srv diff --git a/main.py b/main.py index 65cf4c5..4d64b1b 100644 --- a/main.py +++ b/main.py @@ -18,10 +18,11 @@ # -import os import cherrypy -import hashlib import datetime +import hashlib +import logging +import os import yaml import re @@ -496,18 +497,6 @@ def parseFlow(self, flow=None): return data - def save_settings(self, dev_user=None, dev_pw=None, routers=None, age_out_interval=None): - - self.dev_user = dev_user - self.dev_pw = dev_pw - self.age_out_interval = age_out_interval - # self.routers = routers - - # with open('ui/config.yml', 'w') as fp: - # config = {'dev_user': self.dev_user, 'dev_pw': self.dev_pw, 'routers': self.routers, - # 'age_out_interval': self.age_out_interval} - # yaml.safe_dump(config, fp, default_flow_style=False) - def load_settings(self): with open('ui/config.yml', 'r') as fp: @@ -562,13 +551,6 @@ def POST(self, action=None): resp = self.my_dev.delFlowRoute(flowRouteData=input_json) return resp - elif action == 'save': - - input_json = cherrypy.request.json - self.my_dev.save_settings(dev_user=input_json['user'], dev_pw=input_json['password'], - age_out_interval=input_json['age_out_interval']) - return True, 'Successfully saved configuration settings' - else: return False, 'Action not defined' diff --git a/ui/config.yml b/ui/config.yml deleted file mode 100644 index 0a6b0e5..0000000 --- a/ui/config.yml +++ /dev/null @@ -1,12 +0,0 @@ -age_out_interval: 00:03:00 -dev_pw: juniper123 -dev_user: root -communities: - - bgp_flow_arbor:1000:1666 -routers: - - RR: - type: rr - ip: 10.11.111.120 - - PE: - type: asbr - ip: 10.11.111.121 \ No newline at end of file diff --git a/ui/index.html b/ui/index.html index 83eb822..cdffe57 100644 --- a/ui/index.html +++ b/ui/index.html @@ -46,9 +46,7 @@
- -
-