mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-09-19 04:59:01 +00:00
action_utils: PEP8 fixes and minor changes
This commit is contained in:
parent
d3f386733f
commit
3d5661dc60
@ -21,10 +21,13 @@ Python action utility functions.
|
|||||||
|
|
||||||
from django.utils.translation import ugettext as _
|
from django.utils.translation import ugettext as _
|
||||||
import os
|
import os
|
||||||
|
import logging
|
||||||
import psutil
|
import psutil
|
||||||
import socket
|
import socket
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def is_systemd_running():
|
def is_systemd_running():
|
||||||
"""Return if we are running under systemd."""
|
"""Return if we are running under systemd."""
|
||||||
@ -204,7 +207,6 @@ class WebserverChange(object):
|
|||||||
elif 'reload' in self.actions_required:
|
elif 'reload' in self.actions_required:
|
||||||
service_reload('apache2')
|
service_reload('apache2')
|
||||||
|
|
||||||
|
|
||||||
def enable(self, name, kind='config'):
|
def enable(self, name, kind='config'):
|
||||||
"""Enable a config/module/site in Apache.
|
"""Enable a config/module/site in Apache.
|
||||||
|
|
||||||
@ -233,10 +235,10 @@ def diagnose_port_listening(port, kind='tcp', listen_address=None):
|
|||||||
|
|
||||||
if listen_address:
|
if listen_address:
|
||||||
test = _('Listening on {kind} port {listen_address}:{port}') \
|
test = _('Listening on {kind} port {listen_address}:{port}') \
|
||||||
.format(kind=kind, listen_address=listen_address, port=port)
|
.format(kind=kind, listen_address=listen_address, port=port)
|
||||||
else:
|
else:
|
||||||
test = _('Listening on {kind} port {port}') \
|
test = _('Listening on {kind} port {port}') \
|
||||||
.format(kind=kind, port=port)
|
.format(kind=kind, port=port)
|
||||||
|
|
||||||
return [test, 'passed' if result else 'failed']
|
return [test, 'passed' if result else 'failed']
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user