apt-get install libxml2-dev libxslt-dev gcc python-dev
-- ncclient: NETCONF python client::
+- ncclient: NETCONF python client:
- cd ~
- git clone https://github.com/leopoul/ncclient.git
- cd ncclient
- python setup.py install
+ cd ~
+ git clone https://github.com/leopoul/ncclient.git
+ cd ncclient
+ python setup.py install
-- nxpy: Python Objects from/to XML proxy::
+- nxpy: Python Objects from/to XML proxy:
- cd ~
- git clone https://code.grnet.gr/git/nxpy
- cd nxpy
- python setup.py install
+ cd ~
+ git clone https://code.grnet.gr/git/nxpy
+ cd nxpy
+ python setup.py install
- - flowspy: core application. Installation is done at /srv/flowspy:
+ - flowspy: core web application. Installation is done at /srv/flowspy::
- cd /srv
- git clone https://code.grnet.gr/git/flowspy
- cd flowspy
+ cd /srv
+ git clone https://code.grnet.gr/git/flowspy
+ cd flowspy
Application configuration
=========================
import datetime
import logging
from time import sleep
-from junos import create_junos_name, policer_name
++
+from junos import create_junos_name
+
+
import beanstalkc
from utils.randomizer import id_generator as id_gen
expires = models.DateField(default=days_offset, verbose_name=_("Expires"))
response = models.CharField(max_length=512, blank=True, null=True, verbose_name=_("Response"))
comments = models.TextField(null=True, blank=True, verbose_name=_("Comments"))
+ requesters_address = models.CharField(max_length=255, blank=True, null=True)
++<<<<<<< HEAD
++=======
+
++>>>>>>> 7ae0e0ec4604a3363386ec307eaad6002ed8bd8d
def __unicode__(self):
return self.name
self.name = "%s_%s" %(self.name, hash)
super(Route, self).save(*args, **kwargs) # Call the "real" save() method.
++<<<<<<< HEAD
++=======
+
++>>>>>>> 7ae0e0ec4604a3363386ec307eaad6002ed8bd8d
def clean(self, *args, **kwargs):
from django.core.exceptions import ValidationError
if self.destination:
def commit_add(self, *args, **kwargs):
peer = self.applier.get_profile().peer.peer_tag
- send_message("[%s] Adding rule %s. Please wait..." %(self.applier.username, self.name), peer)
+ send_message("[%s] Adding rule %s. Please wait..." % (self.applier.username, self.name), peer)
response = add.delay(self)
++<<<<<<< HEAD
+ logger.info('Got add job id: %s' % response)
+ fqdn = Site.objects.get_current().domain
+ admin_url = 'https://%s%s' % (
+ fqdn,
+ reverse('edit-route', kwargs={'route_slug': self.name})
+ )
+ mail_body = render_to_string(
+ 'rule_action.txt',
+ {
+ 'route': self,
+ 'address': self.requesters_address,
+ 'action': 'creation',
+ 'url': admin_url
+ }
+ )
+ user_mail = '%s' % self.applier.email
+ user_mail = user_mail.split(';')
+ send_new_mail(
+ settings.EMAIL_SUBJECT_PREFIX + 'Rule %s creation request submitted by %s' % (self.name, self.applier.username),
+ mail_body,
+ settings.SERVER_EMAIL, user_mail,
+ get_peer_techc_mails(self.applier)
+ )
+ d = {
+ 'clientip': '%s' % self.requesters_address,
+ 'user': self.applier.username
+ }
+ logger.info(mail_body, extra=d)
++=======
+ logger.info("Got add job id: %s" %response)
++>>>>>>> 7ae0e0ec4604a3363386ec307eaad6002ed8bd8d
def commit_edit(self, *args, **kwargs):
peer = self.applier.get_profile().peer.peer_tag