mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-09-19 04:59:01 +00:00
Move pagekite module to python logging
This commit is contained in:
parent
b4183618c1
commit
588e3a62bd
@ -27,11 +27,15 @@ from django.template import RequestContext
|
|||||||
from django.template.loader import render_to_string
|
from django.template.loader import render_to_string
|
||||||
from django.template.response import TemplateResponse
|
from django.template.response import TemplateResponse
|
||||||
from gettext import gettext as _
|
from gettext import gettext as _
|
||||||
|
import logging
|
||||||
|
|
||||||
import actions
|
import actions
|
||||||
import cfg
|
import cfg
|
||||||
|
|
||||||
|
|
||||||
|
LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def init():
|
def init():
|
||||||
"""Intialize the PageKite module"""
|
"""Intialize the PageKite module"""
|
||||||
menu = cfg.main_menu.find('/apps')
|
menu = cfg.main_menu.find('/apps')
|
||||||
@ -130,7 +134,6 @@ def get_status():
|
|||||||
|
|
||||||
# Check if PageKite is installed
|
# Check if PageKite is installed
|
||||||
output = _run(['get-installed'])
|
output = _run(['get-installed'])
|
||||||
cfg.log('Output - %s' % output)
|
|
||||||
if output.split()[0] != 'installed':
|
if output.split()[0] != 'installed':
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@ -155,7 +158,7 @@ def get_status():
|
|||||||
|
|
||||||
def _apply_changes(request, old_status, new_status):
|
def _apply_changes(request, old_status, new_status):
|
||||||
"""Apply the changes to PageKite configuration"""
|
"""Apply the changes to PageKite configuration"""
|
||||||
cfg.log.info('New status is - %s' % new_status)
|
LOGGER.info('New status is - %s', new_status)
|
||||||
|
|
||||||
if old_status != new_status:
|
if old_status != new_status:
|
||||||
_run(['stop'])
|
_run(['stop'])
|
||||||
@ -194,8 +197,7 @@ def _run(arguments, superuser=True):
|
|||||||
"""Run an given command and raise exception if there was an error"""
|
"""Run an given command and raise exception if there was an error"""
|
||||||
command = 'pagekite-configure'
|
command = 'pagekite-configure'
|
||||||
|
|
||||||
cfg.log.info('Running command - %s, %s, %s' % (command, arguments,
|
LOGGER.info('Running command - %s, %s, %s', command, arguments, superuser)
|
||||||
superuser))
|
|
||||||
|
|
||||||
if superuser:
|
if superuser:
|
||||||
output, error = actions.superuser_run(command, arguments)
|
output, error = actions.superuser_run(command, arguments)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user