From 8a4e4024a9d43c76947161cb39879f3a54600983 Mon Sep 17 00:00:00 2001
From: David Schmitz <schmitz@lrz.de>
Date: Wed, 7 Jun 2017 11:57:01 +0000
Subject: [PATCH] some minor changes/adaptions for test-fod-lab

---
 flowspec/validators.py               |  2 +-
 flowspy/wsgi.py                      |  2 ++
 requirements.txt                     |  5 +++--
 templates/flowspy/route_details.html | 11 ++---------
 utils/proxy.py                       |  5 +++--
 5 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/flowspec/validators.py b/flowspec/validators.py
index 96bd4e7d..af39f6f7 100644
--- a/flowspec/validators.py
+++ b/flowspec/validators.py
@@ -18,7 +18,7 @@ def get_network(ip):
 
 
 def clean_ip(address):
-    if address.is_private:
+    if False and address.is_private:
             return _('Private addresses not allowed')
 
     if address.version == 4 and int(address.prefixlen) == 32:
diff --git a/flowspy/wsgi.py b/flowspy/wsgi.py
index a570af33..8d533f30 100644
--- a/flowspy/wsgi.py
+++ b/flowspy/wsgi.py
@@ -16,6 +16,8 @@ framework.
 import os
 
 os.environ.setdefault("DJANGO_SETTINGS_MODULE", "flowspy.settings")
+os.environ['HTTPS'] = "on"
+os.environ['wsgi.url_scheme'] = 'https'
 
 # This application object is used by any WSGI server configured to use this
 # file. This includes Django's development server, if the WSGI_APPLICATION
diff --git a/requirements.txt b/requirements.txt
index db767890..00874879 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -7,7 +7,7 @@ django-celery==2.5.5
 django-picklefield==0.2.1
 django-registration==0.8
 djangorestframework==2.3.14
-django-tinymce==1.5
+django-tinymce
 Django==1.4.5
 gevent==0.13.6
 git+https://code.grnet.gr/git/nxpy
@@ -21,9 +21,10 @@ MySQL-python==1.2.3
 ncclient==0.4.3
 paramiko==1.7.7.1
 pycrypto==2.6
-pyparsing==1.5.6
+pyparsing
 python-dateutil==1.5
 python-memcached==1.48
 PyYAML==3.10
 South==0.7.5
 wsgiref==0.1.2
+django-form-utils
diff --git a/templates/flowspy/route_details.html b/templates/flowspy/route_details.html
index fd0cd6f1..89d50cdd 100644
--- a/templates/flowspy/route_details.html
+++ b/templates/flowspy/route_details.html
@@ -68,15 +68,8 @@
         </div>
         <div>
             <h2>Statistics</h2>
-            <div><span id="traffic-plot-loading">(Loading data...)</span>
-            <h3>Number of packets (absolute)</h3>
-	    <div><canvas id="traffic-plot-pkts-abs" width=200 height=200></canvas></div>
-            <h3>Number of packets (relative)</h3>
-            <div><canvas id="traffic-plot-pkts-rel" width=200 height=200></canvas></div>
-            <h3>Number of bytes (absolute)</h3>
-	    <div><canvas id="traffic-plot-bytes-abs" width=200 height=200></canvas></div>
-            <h3>Number of bytes (relative)</h3>
-            <div><canvas id="traffic-plot-bytes-rel" width=200 height=200></canvas></div>
+            <div><canvas id="traffic-plot" width=550 height=150></canvas></div>
+            <div>Number of packets <span id="traffic-plot-loading">(Loading)</span>
         </div>
         <div><a href="{% url routestats route.name %}">Download raw data in JSON</a></div>
     </div>
diff --git a/utils/proxy.py b/utils/proxy.py
index a28d889b..8014a6d8 100644
--- a/utils/proxy.py
+++ b/utils/proxy.py
@@ -180,8 +180,9 @@ class Applier(object):
                 logger.info("Requesting a replace operation")
                 route.operation = operation
             device = device.export(netconf_config=True)
-            logger.debug(ET.tostring(device))
-            return ET.tostring(device)
+            result = ET.tostring(device)
+            logger.error(result)
+            return result
         else:
             return False
 
-- 
GitLab