syslog.LOG_INFO

Here are the examples of the python api syslog.LOG_INFO taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

100 Examples 7

Example 1

Project: mythbox
Source File: test_syslog.py
View license
    def test_emitMessage(self):
        """
        L{SyslogObserver.emit} logs the value of the C{'message'} key of the
        event dictionary it is passed to the syslog.
        """
        self.observer.emit({
                'message': ('hello, world',), 'isError': False,
                'system': '-'})
        self.assertEqual(
            self.events,
            [(stdsyslog.LOG_INFO, "[-] hello, world")])

Example 2

Project: runbook
Source File: rel12-20-14.py
View license
def killhandle(signum, frame):
    ''' This will close connections cleanly '''
    line = "SIGTERM detected, shutting down"
    syslog.syslog(syslog.LOG_INFO, line)
    rdb_server.close()
    # zsend.close()  # zsend?
    syslog.closelog()
    sys.exit(0)

Example 3

Project: neubot
Source File: unix.py
View license
def __verify_sig(signature, tarball):

    '''
     Call OpenSSL to verify the signature.  The public key
     is ``VERSIONDIR/pubkey.pem``.  We assume the signature
     algorithm is SHA256.
    '''

    cmdline = ['/usr/bin/openssl', 'dgst', '-sha256',
               '-verify', '%s/pubkey.pem' % VERSIONDIR,
               '-signature', signature, tarball]

    syslog.syslog(syslog.LOG_INFO, 'Cmdline: %s' % str(cmdline))

    retval = subprocess.call(cmdline)

    if retval != 0:
        raise RuntimeError('Signature does not match')

Example 4

Project: FuzzLabs
Source File: webserver.py
View license
@app.route("/logout", methods=['GET'])
@headers
@validate
@authenticated
def logout():
    syslog.syslog(syslog.LOG_INFO,
                  "user %s logged out from %s" %\
                  (current_user.username, request.remote_addr))
    logout_user()
    return render_template('login.tpl')

Example 5

Project: ansible
Source File: test_log.py
View license
    def test_output_matches(self):
        if sys.version_info >= (3,):
            output_data = self.py3_output_data
        else:
            output_data = self.py2_output_data

        for msg, param in output_data.items():
            with patch('syslog.syslog', autospec=True) as mock_func:
                self.am.log(msg)
                mock_func.assert_called_once_with(syslog.LOG_INFO, param)

Example 6

Project: python-pyhsm
Source File: validation_server.py
View license
def run():
    """
    Start the BaseHTTPServer and serve requests forever.
    """
    server_address = (args.listen_addr, args.listen_port)
    httpd = YHSM_VALServer(server_address, YHSM_VALRequestHandler)
    my_log_message(args, syslog.LOG_INFO, "Serving requests to 'http://%s:%s%s' (YubiHSM: '%s')" \
                       % (args.listen_addr, args.listen_port, args.serve_url, args.device))
    httpd.serve_forever()

Example 7

Project: mythbox
Source File: test_syslog.py
View license
    def test_emitMessage(self):
        """
        L{SyslogObserver.emit} logs the value of the C{'message'} key of the
        event dictionary it is passed to the syslog.
        """
        self.observer.emit({
                'message': ('hello, world',), 'isError': False,
                'system': '-'})
        self.assertEqual(
            self.events,
            [(stdsyslog.LOG_INFO, "[-] hello, world")])

Example 8

Project: neubot
Source File: updater_verify.py
View license
def __logging_info(message, args):
    ''' Wrapper that decides whether to use syslog or logging,
        depending on the operating system. '''
    #
    # XXX Ideally this should be fixed in updater/unix.py but
    # for now we will deal with that here.
    #
    if os.name == 'posix' and not os.isatty(sys.stdin.fileno()):
        syslog.syslog(syslog.LOG_INFO, message % args)
    else:
        logging.info(message, args)

Example 9

View license
    def test_emitMessage(self):
        """
        L{SyslogObserver.emit} logs the value of the C{'message'} key of the
        event dictionary it is passed to the syslog.
        """
        self.observer.emit({
                'message': ('hello, world',), 'isError': False,
                'system': '-'})
        self.assertEqual(
            self.events,
            [(stdsyslog.LOG_INFO, "[-] hello, world")])

Example 10

Project: snmp_passpersist
Source File: snmp-asterisk.py
View license
    def update(self):
        if self.settings.updateFromFile():
            syslog.syslog(syslog.LOG_INFO, 'SipSnmp: reading settings')
            self.assign_oids()
        for oid, setting in self.oids.items():
            section, attr_name = setting
            attr_value = self.settings.get(section, attr_name)
            self.snmp.add_str(self.getNameOid(oid),  attr_name)
            self.snmp.add_str(self.getValueOid(oid), attr_value)

Example 11

Project: python-pyhsm
Source File: yubikey_ksm.py
View license
def run(hsm, aead_backend, args):
    """
    Start a BaseHTTPServer.HTTPServer and serve requests forever.
    """

    write_pid_file(args.pid_file)

    server_address = (args.listen_addr, args.listen_port)
    httpd = YHSM_KSMServer(server_address,
                           partial(YHSM_KSMRequestHandler, hsm, aead_backend, args))
    my_log_message(args.debug or args.verbose, syslog.LOG_INFO,
                   "Serving requests to 'http://%s:%s%s' with key handle(s) %s (YubiHSM: '%s', AEADs in '%s', DB in '%s')"
                   % (args.listen_addr, args.listen_port, args.serve_url, args.key_handles, args.device, args.aead_dir, args.db_url))
    httpd.serve_forever()

Example 12

Project: cve-portal
Source File: user.py
View license
@user_blueprint.route('/change_password', methods=['GET', 'POST'])
@login_required
def change_password():
    form = form_class.ChangePasswordForm()
    if form.validate_on_submit():
        if current_user.verify_password(form.old_password.data):
            current_user.password = form.password.data
            models.db.session.add(current_user)
            models.db.session.commit()
            flash('Your password has been updated.', 'info')
            syslog.syslog(syslog.LOG_INFO, "User changed his password: " + current_user.email)
            return redirect(url_for('main.index'))
        else:
            flash('Invalid password.', 'danger')
    return render_template("auth/change_password.html", form=form)

Example 13

View license
    def test_emitMessage(self):
        """
        L{SyslogObserver.emit} logs the value of the C{'message'} key of the
        event dictionary it is passed to the syslog.
        """
        self.observer.emit({
                'message': ('hello, world',), 'isError': False,
                'system': '-'})
        self.assertEqual(
            self.events,
            [(stdsyslog.LOG_INFO, "[-] hello, world")])

Example 14

Project: vault
Source File: actionlogger.py
View license
    def log(self, user, action, item):
        if action not in self._actions.keys():
            raise ActionNotFound('Invalid action: "%s"' % action)

        self.audit.user = user
        self.audit.action = self._actions[action]
        self.audit.item = self.to_str(item)
        self.audit.save()

        msg = 'User {} {} {}'.format(user, self._actions[action], self.to_str(item))

        syslog.syslog(syslog.LOG_INFO, msg)

Example 15

View license
    def test_emitStripsTrailingEmptyLines(self):
        """
        Trailing empty lines of a multiline message are omitted from the
        messages sent to the syslog.
        """
        self.observer.emit({
                'message': ('hello,\nworld\n\n',), 'isError': False,
                'system': '-'})
        self.assertEqual(
            self.events,
            [(stdsyslog.LOG_INFO, '[-] hello,'),
             (stdsyslog.LOG_INFO, '[-] \tworld')])

Example 16

Project: mythbox
Source File: test_syslog.py
View license
    def test_emitStripsTrailingEmptyLines(self):
        """
        Trailing empty lines of a multiline message are omitted from the
        messages sent to the syslog.
        """
        self.observer.emit({
                'message': ('hello,\nworld\n\n',), 'isError': False,
                'system': '-'})
        self.assertEqual(
            self.events,
            [(stdsyslog.LOG_INFO, '[-] hello,'),
             (stdsyslog.LOG_INFO, '[-] \tworld')])

Example 17

View license
    def test_emitCustomSystem(self):
        """
        L{SyslogObserver.emit} uses the value of the C{'system'} key to prefix
        the logged message.
        """
        self.observer.emit({'message': ('hello, world',), 'isError': False,
            'system': 'nonDefaultSystem'})
        self.assertEqual(
            self.events,
            [(stdsyslog.LOG_INFO, "[nonDefaultSystem] hello, world")])

Example 18

Project: mythbox
Source File: test_syslog.py
View license
    def test_emitStripsTrailingEmptyLines(self):
        """
        Trailing empty lines of a multiline message are omitted from the
        messages sent to the syslog.
        """
        self.observer.emit({
                'message': ('hello,\nworld\n\n',), 'isError': False,
                'system': '-'})
        self.assertEqual(
            self.events,
            [(stdsyslog.LOG_INFO, '[-] hello,'),
             (stdsyslog.LOG_INFO, '[-] \tworld')])

Example 19

Project: nyx
Source File: palo_alto.py
View license
def pan_commit(settings):
    """Once we are happy with the settings, we will commit them to PAN
    partial commits are not as effective as hoped
    """
    url=settings['url']+'?type=commit&cmd=<commit></commit>&key='+settings['api_key']
    r=requests.get(url,verify=False)
    if r.status_code == 200 and 'code="19"'in r.text:
        syslog.syslog(syslog.LOG_INFO,'nyx->PAN: successfully sent commit command')

Example 20

Project: neubot
Source File: unix.py
View license
def __verify_sig(signature, tarball):

    '''
     Call OpenSSL to verify the signature.  The public key
     is ``VERSIONDIR/pubkey.pem``.  We assume the signature
     algorithm is SHA256.
    '''

    cmdline = ['/usr/bin/openssl', 'dgst', '-sha256',
               '-verify', '%s/pubkey.pem' % VERSIONDIR,
               '-signature', signature, tarball]

    syslog.syslog(syslog.LOG_INFO, 'Cmdline: %s' % str(cmdline))

    retval = subprocess.call(cmdline)

    if retval != 0:
        raise RuntimeError('Signature does not match')

Example 21

View license
    def test_emitStripsTrailingEmptyLines(self):
        """
        Trailing empty lines of a multiline message are omitted from the
        messages sent to the syslog.
        """
        self.observer.emit({
                'message': ('hello,\nworld\n\n',), 'isError': False,
                'system': '-'})
        self.assertEqual(
            self.events,
            [(stdsyslog.LOG_INFO, '[-] hello,'),
             (stdsyslog.LOG_INFO, '[-] \tworld')])

Example 22

Project: ansible
Source File: test_log.py
View license
    @patch('syslog.syslog', autospec=True)
    def test_no_log(self, mock_func):
        no_log = self.am.no_log

        self.am.no_log = True
        self.am.log('unittest no_log')
        self.assertFalse(mock_func.called)

        self.am.no_log = False
        self.am.log('unittest no_log')
        mock_func.assert_called_once_with(syslog.LOG_INFO, 'unittest no_log')

        self.am.no_log = no_log

Example 23

Project: nyx
Source File: palo_alto.py
View license
def add_ip(ip,settings,pan_list,tags):
    """ adds an ip in the address group. Will have to create the object first then the address group"""
    # adding the adress object
    tag_str="<member>"+pan_list+"</member>"
    for tag in tags:
        clean_tag='dvn_intel_'+tag.replace(" ","_")
        tag_str+="<member>"+clean_tag+"</member>"
    url=settings['url']+'?type=config&action=set&key='+settings['api_key']+"&xpath=/config/shared/address/entry[@name='"+ip+"']&element=<ip-netmask>"+ip+"/32</ip-netmask><tag>"+tag_str+"</tag>"
    r_actor=requests.get(url,verify=False)
    if r_actor and r_actor.status_code == 200 and 'code="20"' in r_actor.text:
        syslog.syslog(syslog.LOG_INFO,'nyx->PAN: successfully added %s to %s '% (ip, pan_list))
        return True
    else:
        syslog.syslog(syslog.LOG_ERR,'nyx->PAN: problems adding %s to %s '% (ip, pan_list))
        print r_actor.text
        return False

Example 24

Project: cve-portal
Source File: user.py
View license
@user_blueprint.route('/login', methods=['GET', 'POST'])
def login():
    form = form_class.LoginForm()
    if form.validate_on_submit():
        user = models.User.query.filter_by(email=form.email.data).first()
        if user is not None and user.verify_password(form.password.data):
            login_user(user, form.remember_me.data)
            flash('You are now logged', 'success')
            syslog.syslog(syslog.LOG_INFO, "User Logged: " + form.email.data)
            return redirect(request.args.get("next") or url_for("main.index"))
        flash('Wrong email/password', 'danger')
        syslog.syslog(syslog.LOG_ERR, "User Login Failed: " + form.email.data)
    return render_template('auth/login.html', form=form)

Example 25

Project: radish
Source File: syslog_writer.py
View license
    def log(self, message):
        """
            Logs the given message to the syslog

            :param string message: the message to log
        """
        try:
            if isinstance(message, unicode):
                message = message.encode("utf8")
        except Exception:  # pylint: disable=broad-except
            pass
        finally:
            syslog.syslog(syslog.LOG_INFO, message)

Example 26

Project: FuzzLabs
Source File: CollectorDaemon.py
View license
    def __sigterm_handler(self, signum, frame):
        """
        Handle SIGTERM signal and abort execution.
        """

        syslog.syslog(syslog.LOG_INFO, 'FuzzLabs collector is stopping')
        for r_thread in self.thread_queue:
            syslog.syslog(syslog.LOG_INFO, 'collector: stopping engine handler thread')
            r_thread["instance"].stop()
        self.running = False

Example 27

Project: synctool
Source File: lib.py
View license
def _masterlog(msg):
    '''log only locally (on the master node)'''

    if DRY_RUN or not param.SYSLOGGING:
        return

    syslog.syslog(syslog.LOG_INFO|syslog.LOG_USER, msg)

Example 28

View license
    def test_emitMultilineMessage(self):
        """
        Each line of a multiline message is emitted separately to the syslog.
        """
        self.observer.emit({
                'message': ('hello,\nworld',), 'isError': False,
                'system': '-'})
        self.assertEqual(
            self.events,
            [(stdsyslog.LOG_INFO, '[-] hello,'),
             (stdsyslog.LOG_INFO, '[-] \tworld')])

Example 29

Project: FuzzLabs
Source File: EngineThread.py
View license
    def run(self):
        syslog.syslog(syslog.LOG_INFO, 'FuzzLabs engine thread is running')

        while self.running:
            if not self.process_jobs():    self.running = False
            if not self.process_issues():  self.running = False
            time.sleep(self.config["general"]["data_collect_interval"])

        self.clear_thread_queue()
        syslog.syslog(syslog.LOG_INFO, 'FuzzLabs engine thread has stopped')

Example 30

Project: nyx
Source File: palo_alto.py
View license
def add_tag(tag,settings):
    """ adds an ip in the address group. Will have to create the object first then the address group"""
    # adding the adress object
    url=settings['url']+'?type=config&action=set&key='+settings['api_key']+"&xpath=/config/shared/tag/entry[@name='"+tag+"']&element=<color>color1</color>"
    r_actor=requests.get(url,verify=False)
    if r_actor and r_actor.status_code == 200 and 'code="20"' in r_actor.text:
        syslog.syslog(syslog.LOG_INFO,'nyx->PAN: successfully added tag: %s '% (tag))
        return True
    else:
        syslog.syslog(syslog.LOG_ERR,'nyx->PAN: problems adding tag: %s '% (tag))
        return False

Example 31

Project: runbook
Source File: rel8-02-14.py
View license
def killhandle(signum, frame):
    ''' This will close connections cleanly '''
    line = "SIGTERM detected, shutting down"
    syslog.syslog(syslog.LOG_INFO, line)
    rdb_server.close()
    zsend.close()  # zsend?
    syslog.closelog()
    sys.exit(0)

Example 32

View license
    def test_emitCustomSystem(self):
        """
        L{SyslogObserver.emit} uses the value of the C{'system'} key to prefix
        the logged message.
        """
        self.observer.emit({'message': ('hello, world',), 'isError': False,
            'system': 'nonDefaultSystem'})
        self.assertEqual(
            self.events,
            [(stdsyslog.LOG_INFO, "[nonDefaultSystem] hello, world")])

Example 33

Project: mythbox
Source File: test_syslog.py
View license
    def test_emitCustomSystem(self):
        """
        L{SyslogObserver.emit} uses the value of the C{'system'} key to prefix
        the logged message.
        """
        self.observer.emit({'message': ('hello, world',), 'isError': False,
            'system': 'nonDefaultSystem'})
        self.assertEqual(
            self.events,
            [(stdsyslog.LOG_INFO, "[nonDefaultSystem] hello, world")])

Example 34

Project: nyx
Source File: plugin_template.py
View license
def add_ip(ip,settings,intel_list,tags):
    """ adds an IP to the pre-established list. The tags might or might not be supported by the control"""
    
    # your code here
    
    if "[condition for confirming a successful addition":
        syslog.syslog(syslog.LOG_INFO,'nyx->[this_plugin]: successfully added %s to %s'% (ip,intel_list))
        return True
    else:
        syslog.syslog(syslog.LOG_ERR,'nyx->[this_plugin]: problems adding %s to %s'% (ip,intel_list))
        return False

Example 35

Project: mythbox
Source File: test_syslog.py
View license
    def test_emitMultilineMessage(self):
        """
        Each line of a multiline message is emitted separately to the syslog.
        """
        self.observer.emit({
                'message': ('hello,\nworld',), 'isError': False,
                'system': '-'})
        self.assertEqual(
            self.events,
            [(stdsyslog.LOG_INFO, '[-] hello,'),
             (stdsyslog.LOG_INFO, '[-] \tworld')])

Example 36

Project: backintime
Source File: logger.py
View license
def info(msg , parent = None, traceDepth = 0):
    if DEBUG:
        msg = '%s %s' %(_debugHeader(parent, traceDepth), msg)
    print('%sINFO%s: %s' %(bcolors.OKGREEN, bcolors.ENDC, msg), file=sys.stdout)
    for line in tools.wrapLine(msg):
        syslog.syslog(syslog.LOG_INFO, 'INFO: ' + line)

Example 37

Project: mythbox
Source File: test_syslog.py
View license
    def test_emitCustomSystem(self):
        """
        L{SyslogObserver.emit} uses the value of the C{'system'} key to prefix
        the logged message.
        """
        self.observer.emit({'message': ('hello, world',), 'isError': False,
            'system': 'nonDefaultSystem'})
        self.assertEqual(
            self.events,
            [(stdsyslog.LOG_INFO, "[nonDefaultSystem] hello, world")])

Example 38

Project: nyx
Source File: palo_alto.py
View license
def add_domain(site,settings,pan_list):
    """ adds a url to Palo Alto custom URL list"""
    url=settings['url']+'?type=config&action=set&key='+settings['api_key']+"&xpath=/config/shared/profiles/custom-url-category/entry[@name=%27"+pan_list+'%27]/list&element=<member>'+site+'</member>'
    r=requests.get(url,verify=False)
    # if this is a domain, adding the * subdomains
    if len(site.split('.'))<3:
        url=settings['url']+'?type=config&action=set&key='+settings['api_key']+"&xpath=/config/shared/profiles/custom-url-category/entry[@name=%27"+pan_list+'%27]/list&element=<member>'+"*."+site+'</member>'
        r=requests.get(url,verify=False)
    if r and r.status_code == 200 and 'code="20"' in r.text:
        syslog.syslog(syslog.LOG_INFO,'nyx->PAN: successfully added %s to %s '% (site, pan_list))
        return True
    else:
        syslog.syslog(syslog.LOG_ERR,'nyx->PAN: problems adding %s to %s '% (site, pan_list))
        print r.text
        return False

Example 39

Project: mythbox
Source File: test_syslog.py
View license
    def test_emitMultilineMessage(self):
        """
        Each line of a multiline message is emitted separately to the syslog.
        """
        self.observer.emit({
                'message': ('hello,\nworld',), 'isError': False,
                'system': '-'})
        self.assertEqual(
            self.events,
            [(stdsyslog.LOG_INFO, '[-] hello,'),
             (stdsyslog.LOG_INFO, '[-] \tworld')])

Example 40

Project: neubot
Source File: updater_verify.py
View license
def __logging_info(message, args):
    ''' Wrapper that decides whether to use syslog or logging,
        depending on the operating system. '''
    #
    # XXX Ideally this should be fixed in updater/unix.py but
    # for now we will deal with that here.
    #
    if os.name == 'posix' and not os.isatty(sys.stdin.fileno()):
        syslog.syslog(syslog.LOG_INFO, message % args)
    else:
        logging.info(message, args)

Example 41

Project: snmp_passpersist
Source File: snmp-asterisk.py
View license
    def update(self):
        if self.settings.updateFromFile():
            syslog.syslog(syslog.LOG_INFO, 'SipSnmp: reading settings')
            self.assign_oids()
        for oid, setting in self.oids.items():
            section, attr_name = setting
            attr_value = self.settings.get(section, attr_name)
            self.snmp.add_str(self.getNameOid(oid),  attr_name)
            self.snmp.add_str(self.getValueOid(oid), attr_value)

Example 42

Project: nyx
Source File: plugin_template.py
View license
def add_domain(domain,settings,intel_list,tags):
    """ adds an domain to the pre-established list. The tags might or might not be supported by the control"""
    
    # your code here
    
    if "[condition for confirming a successful addition":
        syslog.syslog(syslog.LOG_INFO,'nyx->[this_plugin]: successfully added %s to %s'% (ip,intel_list))
        return True
    else:
        syslog.syslog(syslog.LOG_ERR,'nyx->[this_plugin]: problems adding %s to %s'% (ip,intel_list))
        return False

Example 43

Project: ansible
Source File: test_log.py
View license
    def test_output_matches(self):
        if sys.version_info >= (3,):
            output_data = self.py3_output_data
        else:
            output_data = self.py2_output_data

        for msg, param in output_data.items():
            with patch('syslog.syslog', autospec=True) as mock_func:
                self.am.log(msg)
                mock_func.assert_called_once_with(syslog.LOG_INFO, param)

Example 44

View license
    def test_emitMultilineMessage(self):
        """
        Each line of a multiline message is emitted separately to the syslog.
        """
        self.observer.emit({
                'message': ('hello,\nworld',), 'isError': False,
                'system': '-'})
        self.assertEqual(
            self.events,
            [(stdsyslog.LOG_INFO, '[-] hello,'),
             (stdsyslog.LOG_INFO, '[-] \tworld')])

Example 45

Project: nyx
Source File: plugin_template.py
View license
def remove_domain(domain,settings):
    """ removes a domain from the control"""
    
    # your code here
    
    
    if "[conditions for successful removal]":
        syslog.syslog(syslog.LOG_INFO,'nyx->[this_plugin]:: successfully removed %s'% (ip))
        return True
    else:
        syslog.syslog(syslog.LOG_ERR,'nyx->[this_plugin]: problems removing %s'% (ip))
        return False

Example 46

Project: nyx
Source File: plugin_template.py
View license
def remove_ip(ip,settings):
    """ removes an IP from the control"""
    
    # your code here
    
    
    if "[conditions for successful removal]":
        syslog.syslog(syslog.LOG_INFO,'nyx->[this_plugin]:: successfully removed %s'% (ip))
        return True
    else:
        syslog.syslog(syslog.LOG_ERR,'nyx->[this_plugin]: problems removing %s'% (ip))
        return False

Example 47

Project: nyx
Source File: palo_alto.py
View license
def remove_ip_from_panorama(ip,settings):
    """ removes an IP address from panorama """
    url=settings['url']+'?type=config&action=delete&key='+settings['api_key']+"&xpath=/config/shared/address/entry[@name='"+ip+"']"
    r_actor=requests.get(url,verify=False)
    if r_actor and r_actor.status_code == 200 and 'code="20"' in r_actor.text:
        syslog.syslog(syslog.LOG_INFO,'nyx->PAN: successfully removed %s'% (ip))
        return True
    else:
        syslog.syslog(syslog.LOG_ERR,'nyx->PAN: problems removing %s'% (ip))
        print r_actor.text
        return False

Example 48

Project: ansible
Source File: test_log.py
View license
    @patch('syslog.syslog', autospec=True)
    def test_no_log(self, mock_func):
        no_log = self.am.no_log

        self.am.no_log = True
        self.am.log('unittest no_log')
        self.assertFalse(mock_func.called)

        self.am.no_log = False
        self.am.log('unittest no_log')
        mock_func.assert_called_once_with(syslog.LOG_INFO, 'unittest no_log')

        self.am.no_log = no_log

Example 49

Project: runbook
Source File: rel7-29-14.py
View license
def killhandle(signum, frame):
    ''' This will close connections cleanly '''
    line = "SIGTERM detected, shutting down"
    syslog.syslog(syslog.LOG_INFO, line)
    rdb_server.close()
    zsend.close()  # zsend?
    syslog.closelog()
    sys.exit(0)

Example 50

Project: cve-portal
Source File: user.py
View license
@user_blueprint.route('/change_email/<token>')
@login_required
def change_email(token):
    if current_user.change_email(token):
        syslog.syslog(syslog.LOG_INFO, "User e-mail updated: " + current_user.email)
        flash('Your email address has been updated.', 'success')
    else:
        syslog.syslog(syslog.LOG_ERR, "Email change: Invalid link request: " + current_user.email)
        flash('Invalid request.', 'warning')
    return redirect(url_for('main.index'))