summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsever-sever <v.gletenko@vyos.io>2021-01-18 12:00:24 +0000
committerDaniil Baturin <daniil@baturin.org>2021-01-18 13:17:47 +0100
commitc4fd7d2e055dba1801b14bf679b570036fb6255f (patch)
tree91bb571678cc6113a229eda0c052b32ee399c962
parent4c394baa030ea79806cd27ebd682fac95e4e1f81 (diff)
downloadvyatta-cfg-quagga-c4fd7d2e055dba1801b14bf679b570036fb6255f.tar.gz
vyatta-cfg-quagga-c4fd7d2e055dba1801b14bf679b570036fb6255f.zip
rpki: T3230: Fix delete section for protocol rpki
-rw-r--r--scripts/vyos-update-rpki-cache.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/scripts/vyos-update-rpki-cache.py b/scripts/vyos-update-rpki-cache.py
index 1b5bee96..df6f01bc 100644
--- a/scripts/vyos-update-rpki-cache.py
+++ b/scripts/vyos-update-rpki-cache.py
@@ -39,6 +39,13 @@ def create_cache(c, cache):
def delete_cache(c, cache):
ssh = False
+ port = c.return_effective_value(base_path + "cache {0} port".format(cache))
+ addr = c.return_effective_value(base_path + "cache {0} address".format(cache))
+ pref = c.return_effective_value(base_path + "cache {0} preference".format(cache))
+
+ if not pref:
+ pref = 1
+
if c.exists_effective(base_path + "cache {0} ssh".format(cache)):
ssh = True
user = c.return_effective_value(base_path + "cache {0} ssh username".format(cache))
@@ -46,17 +53,11 @@ def delete_cache(c, cache):
privkey = c.return_effective_value(base_path + "cache {0} ssh private-key-file".format(cache))
known_hosts = c.return_effective_value(base_path + "cache {0} ssh known-hosts-file".format(cache))
- port = c.return_effective_value(base_path + "cache {0} port".format(cache))
- addr = c.return_effective_value(base_path + "cache {0} address".format(cache))
- pref = c.return_effective_value(base_path + "cache {0} preference".format(cache))
-
- if not pref:
- pref = 1
-
if ssh:
subprocess.call(""" vtysh -c 'conf t' -c 'rpki' -c 'no rpki cache {0} {1} {2} {3} {4} {5} preference {6}' """.format(addr, port, user, privkey, pubkey, known_hosts, pref), shell=True)
- else:
- subprocess.call(""" vtysh -c 'conf t' -c 'rpki' -c 'no rpki cache {0} {1} preference {2}' """.format(addr, port, pref), shell=True)
+
+ else:
+ subprocess.call(""" vtysh -c 'conf t' -c 'rpki' -c 'no rpki cache {0} {1} preference {2}' """.format(addr, port, pref), shell=True)
config = vyos.config.Config()