mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-28 08:03:36 +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 _
|
||||
import os
|
||||
import logging
|
||||
import psutil
|
||||
import socket
|
||||
import subprocess
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def is_systemd_running():
|
||||
"""Return if we are running under systemd."""
|
||||
@ -204,7 +207,6 @@ class WebserverChange(object):
|
||||
elif 'reload' in self.actions_required:
|
||||
service_reload('apache2')
|
||||
|
||||
|
||||
def enable(self, name, kind='config'):
|
||||
"""Enable a config/module/site in Apache.
|
||||
|
||||
@ -233,10 +235,10 @@ def diagnose_port_listening(port, kind='tcp', listen_address=None):
|
||||
|
||||
if listen_address:
|
||||
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:
|
||||
test = _('Listening on {kind} port {port}') \
|
||||
.format(kind=kind, port=port)
|
||||
.format(kind=kind, port=port)
|
||||
|
||||
return [test, 'passed' if result else 'failed']
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user