Merge branch 'dev' of https://github.com/grnet/flowspy into dev
authorStauros Kroustouris <staurosk@noc.grnet.gr>
Thu, 8 Jan 2015 14:45:54 +0000 (16:45 +0200)
committerStauros Kroustouris <staurosk@noc.grnet.gr>
Thu, 8 Jan 2015 14:45:54 +0000 (16:45 +0200)
Conflicts:
ChangeLog
_version.py
doc/index.md
flowspec/models.py
flowspec/views.py
flowspy/settings.py.dist

1  2 
ChangeLog
doc/index.md
flowspec/models.py
flowspy/settings.py.dist

diff --cc ChangeLog
+++ b/ChangeLog
@@@ -1,16 -1,9 +1,17 @@@
--===========
++=======
 +1.1.2 RELEASE
 +Updates and enhancements. Check documentation for updating from previous versions
 +
 +      - Rest Api
 +      - Use Django signals for notifications
 +
 +=======
  1.1.1 RELEASE
  Minor changes release
  
        - Change license to GPLv3
 -      - Minor documentation updates 
++
 +      - Minor documentation updates
  
  ===========
  1.1.0 RELEASE
diff --cc doc/index.md
@@@ -122,25 -62,25 +122,25 @@@ Get the required packages and their dep
  
      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
  =========================
@@@ -31,8 -26,8 +31,10 @@@ from ipaddr import 
  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
  
@@@ -172,8 -167,8 +174,12 @@@ class Route(models.Model)
      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
@@@ -1,10 -1,6 +1,9 @@@
  # -*- coding: utf-8 -*- vim:fileencoding=utf-8:
  # vim: tabstop=4:shiftwidth=4:softtabstop=4:expandtab
  # Django settings for flowspy project.
 +# Copyright © 2011-2015 Greek Research and Technology Network (GRNET S.A.)
 +# Copyright © 2011-2014 Leonidas Poulopoulos (@leopoul)
 +# Copyright © 2014-2015 Stavros Kroustouris (@kroustou)
  #
  # This program is free software: you can redistribute it and/or modify
  # it under the terms of the GNU General Public License as published by