From fe182a0faac17f1a542f0edb6b2bd490d3a46592 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Wed, 30 Oct 2019 14:39:24 -0700 Subject: [PATCH] wireguard: Cosmetic fixes by yapf and isort Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- actions/wireguard | 21 +++++++++++---------- plinth/modules/wireguard/__init__.py | 1 - 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/actions/wireguard b/actions/wireguard index 6465da242..871dd98a9 100755 --- a/actions/wireguard +++ b/actions/wireguard @@ -114,23 +114,24 @@ def subcommand_setup(_): stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, check=True) except subprocess.CalledProcessError: - subprocess.run( - ['ip', 'link', 'add', 'dev', SERVER_INTERFACE, 'type', - 'wireguard'], check=True) + subprocess.run([ + 'ip', 'link', 'add', 'dev', SERVER_INTERFACE, 'type', 'wireguard' + ], check=True) if not (PUBLIC_KEY_PATH.exists() and PRIVATE_KEY_PATH.exists()): _generate_key_pair() # Configure interface. - subprocess.run( - ['wg', 'set', SERVER_INTERFACE, 'listen-port', '51820', 'private-key', - str(PRIVATE_KEY_PATH)], check=True) + subprocess.run([ + 'wg', 'set', SERVER_INTERFACE, 'listen-port', '51820', 'private-key', + str(PRIVATE_KEY_PATH) + ], check=True) def _get_info(): """Return info for each configured interface.""" - output = subprocess.check_output( - ['wg', 'show', 'all', 'dump']).decode().strip() + output = subprocess.check_output(['wg', 'show', 'all', + 'dump']).decode().strip() lines = output.split('\n') interfaces = {} for line in lines: @@ -183,8 +184,8 @@ def subcommand_remove_client(arguments): def _find_next_interface(): """Find next unused wireguard interface name.""" - output = subprocess.check_output( - ['wg', 'show', 'interfaces']).decode().strip() + output = subprocess.check_output(['wg', 'show', + 'interfaces']).decode().strip() interfaces = output.split() interface_num = 1 new_interface_name = 'wg1' diff --git a/plinth/modules/wireguard/__init__.py b/plinth/modules/wireguard/__init__.py index fc02e46ad..3fcff2b85 100644 --- a/plinth/modules/wireguard/__init__.py +++ b/plinth/modules/wireguard/__init__.py @@ -31,7 +31,6 @@ from plinth.utils import format_lazy from .manifest import clients # noqa, pylint: disable=unused-import - version = 1 managed_packages = ['wireguard']