mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-28 08:03:36 +00:00
Move config module to python logging
This commit is contained in:
parent
ae02192009
commit
8d477fceb7
@ -25,6 +25,7 @@ from django.contrib.auth.decorators import login_required
|
||||
from django.core import validators
|
||||
from django.template.response import TemplateResponse
|
||||
from gettext import gettext as _
|
||||
import logging
|
||||
import re
|
||||
import socket
|
||||
|
||||
@ -33,6 +34,9 @@ import cfg
|
||||
import util
|
||||
|
||||
|
||||
LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def get_hostname():
|
||||
"""Return the hostname"""
|
||||
return socket.gethostname()
|
||||
@ -155,11 +159,11 @@ def set_hostname(hostname):
|
||||
# valid_hostname check, convert to ASCII.
|
||||
hostname = str(hostname)
|
||||
|
||||
cfg.log.info("Changing hostname to '%s'" % hostname)
|
||||
LOGGER.info('Changing hostname to - %s', hostname)
|
||||
try:
|
||||
actions.superuser_run("xmpp-pre-hostname-change")
|
||||
actions.superuser_run("hostname-change", hostname)
|
||||
actions.superuser_run("xmpp-hostname-change", hostname, async=True)
|
||||
actions.superuser_run('xmpp-pre-hostname-change')
|
||||
actions.superuser_run('hostname-change', hostname)
|
||||
actions.superuser_run('xmpp-hostname-change', hostname, async=True)
|
||||
except OSError:
|
||||
return False
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user