summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-08-23 14:56:08 +0200
committerChristian Poessinger <christian@poessinger.com>2021-08-23 14:56:08 +0200
commit618f30225e8cd69fcbff475d2adff0785a621620 (patch)
tree238b46c8044c2e81dec33a8ba8fde4eb7728d0c9 /src
parentbf2a921d6727e16b26e6294a9fe0eb6b896a4ba5 (diff)
downloadvyos-1x-618f30225e8cd69fcbff475d2adff0785a621620.tar.gz
vyos-1x-618f30225e8cd69fcbff475d2adff0785a621620.zip
ipsec: T1210: use ConfigTreeQuery() instead of Config() from op-mode
Diffstat (limited to 'src')
-rwxr-xr-xsrc/op_mode/ikev2_profile_generator.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/op_mode/ikev2_profile_generator.py b/src/op_mode/ikev2_profile_generator.py
index d45525431..990b06c12 100755
--- a/src/op_mode/ikev2_profile_generator.py
+++ b/src/op_mode/ikev2_profile_generator.py
@@ -21,7 +21,7 @@ from sys import exit
from socket import getfqdn
from cryptography.x509.oid import NameOID
-from vyos.config import Config
+from vyos.configquery import ConfigTreeQuery
from vyos.pki import load_certificate
from vyos.template import render_to_string
from vyos.util import ask_input
@@ -117,7 +117,7 @@ args = parser.parse_args()
ipsec_base = ['vpn', 'ipsec']
config_base = ipsec_base + ['remote-access', 'connection']
pki_base = ['pki']
-conf = Config()
+conf = ConfigTreeQuery()
if not conf.exists(config_base):
exit('IPSec remote-access is not configured!')
@@ -153,7 +153,7 @@ cert = load_certificate(pki['certificate'][cert_name]['certificate'])
data['ca_cn'] = ca_cert.subject.get_attributes_for_oid(NameOID.COMMON_NAME)[0].value
data['cert_cn'] = cert.subject.get_attributes_for_oid(NameOID.COMMON_NAME)[0].value
-data['ca_cert'] = conf.return_value(pki_base + ['ca', ca_name, 'certificate'])
+data['ca_cert'] = conf.value(pki_base + ['ca', ca_name, 'certificate'])
esp_proposals = conf.get_config_dict(ipsec_base + ['esp-group', data['esp_group'], 'proposal'],
key_mangling=('-', '_'), get_first_key=True)