diff options
-rw-r--r-- | python/vyos/xml/kw.py | 1 | ||||
-rw-r--r-- | python/vyos/xml/load.py | 2 | ||||
-rwxr-xr-x | src/op_mode/show_ipsec_sa.py | 8 |
3 files changed, 5 insertions, 6 deletions
diff --git a/python/vyos/xml/kw.py b/python/vyos/xml/kw.py index 64521c51a..58d47e751 100644 --- a/python/vyos/xml/kw.py +++ b/python/vyos/xml/kw.py @@ -27,7 +27,6 @@ def found(word): # root -version = '[version]' tree = '[tree]' priorities = '[priorities]' owners = '[owners]' diff --git a/python/vyos/xml/load.py b/python/vyos/xml/load.py index 1f463a5b7..0965d4220 100644 --- a/python/vyos/xml/load.py +++ b/python/vyos/xml/load.py @@ -115,7 +115,7 @@ def _format_nodes(inside, conf, xml): nodetype = 'tagNode' nodename = kw.tagNode elif 'syntaxVersion' in conf.keys(): - r[kw.version] = conf.pop('syntaxVersion')['@version'] + conf.pop('syntaxVersion') continue else: _fatal(conf.keys()) diff --git a/src/op_mode/show_ipsec_sa.py b/src/op_mode/show_ipsec_sa.py index 066e36b5e..c98ced158 100755 --- a/src/op_mode/show_ipsec_sa.py +++ b/src/op_mode/show_ipsec_sa.py @@ -43,8 +43,11 @@ for sa in sas: # list_sas() returns a list of single-item dicts for peer in sa: parent_sa = sa[peer] + child_sas = parent_sa["child-sas"] + installed_sas = {k: v for k, v in child_sas.items() if v["state"] == b"INSTALLED"} - if parent_sa["state"] == b"ESTABLISHED": + # parent_sa["state"] = IKE state, child_sas["state"] = ESP state + if parent_sa["state"] == b"ESTABLISHED" and installed_sas: state = "up" else: state = "down" @@ -61,9 +64,6 @@ for sa in sas: remote_id = "N/A" # The counters can only be obtained from the child SAs - child_sas = parent_sa["child-sas"] - installed_sas = {k: v for k, v in child_sas.items() if v["state"] == b"INSTALLED"} - if not installed_sas: data = [peer, state, "N/A", "N/A", "N/A", "N/A", "N/A", "N/A"] sa_data.append(data) |