From 4cb103977d356ebb90d561bbd94007f1f7c867ab Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Mon, 30 May 2022 16:18:23 +0200 Subject: [PATCH] Fix incorrect destination path for --mode autoload In commit 3666624f5f the creation and saving of the files required by openvpn3-autload was moved into the AutoloadConfig class. But it ignored the proper destination directory, resulting in the destination directory becoming '/'. Signed-off-by: David Sommerseth --- openvpn/connector/autoload.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openvpn/connector/autoload.py b/openvpn/connector/autoload.py index 0a7c225..6800378 100644 --- a/openvpn/connector/autoload.py +++ b/openvpn/connector/autoload.py @@ -26,12 +26,13 @@ class AutoloadConfig(object): def __init__(self, profile, rootdir, cfgname_prefix): self._profile = profile self._rootdir = rootdir + self._config_dir = os.path.join(self._rootdir, 'etc','openvpn3','autoload') al_cfgname = '%s.autoload' % cfgname_prefix - self._autoload_file = os.path.join(rootdir, al_cfgname) + self._autoload_file = os.path.join(self._config_dir, al_cfgname) vpn_cfgname = '%s.conf' % cfgname_prefix - self._config_file = os.path.join(rootdir, vpn_cfgname) + self._config_file = os.path.join(self._config_dir, vpn_cfgname) self._properties = {} @@ -59,8 +60,7 @@ def SetTunnelParams(self, key, value): def Save(self): # Ensure proper destination directories exists - config_dir = os.path.join(self._rootdir, 'etc','openvpn3','autoload') - Path(config_dir).mkdir(parents=True, exist_ok=True) + Path(self._config_dir).mkdir(parents=True, exist_ok=True) print('Saving VPN configuration profile to "%s" ... ' % self._config_file, end='', flush=True) self._profile.Save(self._config_file)