From 4d0c5c848fda305055b71abf63ccd18478586694 Mon Sep 17 00:00:00 2001 From: Thomas Mangin Date: Mon, 18 May 2020 17:41:35 +0100 Subject: flake8: T2475: fix a number of issue reported by flake8 --- src/conf_mode/interfaces-tunnel.py | 4 ++-- src/conf_mode/ipsec-settings.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/conf_mode') diff --git a/src/conf_mode/interfaces-tunnel.py b/src/conf_mode/interfaces-tunnel.py index 5261b6e7d..8e9bb069e 100755 --- a/src/conf_mode/interfaces-tunnel.py +++ b/src/conf_mode/interfaces-tunnel.py @@ -222,7 +222,7 @@ class ConfigurationState(Config): remove all the values which were not changed from the default """ for option in options: - if self.exists(option) and self_return_value(option) != self.default[option]: + if self.exists(option) and self.self_return_value(option) != self.default[option]: continue del self.options[option] @@ -555,7 +555,7 @@ def verify(conf): # source-interface check if tun_dev and tun_dev not in options['interfaces']: - raise ConfigError(f'device "{dev}" does not exist') + raise ConfigError(f'device "{tun_dev}" does not exist') # tunnel encapsulation check diff --git a/src/conf_mode/ipsec-settings.py b/src/conf_mode/ipsec-settings.py index 3398bcdf2..6282c2cc7 100755 --- a/src/conf_mode/ipsec-settings.py +++ b/src/conf_mode/ipsec-settings.py @@ -99,7 +99,7 @@ def get_config(): def write_ipsec_secrets(c): if c.get("ipsec_l2tp_auth_mode") == "pre-shared-secret": secret_txt = "{0}\n{1} %any : PSK \"{2}\"\n{3}\n".format(delim_ipsec_l2tp_begin, c['outside_addr'], c['ipsec_l2tp_secret'], delim_ipsec_l2tp_end) - elif data.get("ipsec_l2tp_auth_mode") == "x509": + elif c.get("ipsec_l2tp_auth_mode") == "x509": secret_txt = "{0}\n: RSA {1}\n{2}\n".format(delim_ipsec_l2tp_begin, c['server_key_file_copied'], delim_ipsec_l2tp_end) old_umask = os.umask(0o077) -- cgit v1.2.3