summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorsever-sever <v.gletenko@vyos.io>2021-01-18 12:00:24 +0000
committersever-sever <v.gletenko@vyos.io>2021-01-18 12:00:24 +0000
commitdb511af1402b21a4df445e285a5bbfb73fa40ce9 (patch)
tree69ce5ad5246da800c66b17f9dcb8f0a361e5b31c /scripts
parent4cd2ab8738d8802868e387d67a011b1055e709ed (diff)
downloadvyatta-cfg-quagga-db511af1402b21a4df445e285a5bbfb73fa40ce9.tar.gz
vyatta-cfg-quagga-db511af1402b21a4df445e285a5bbfb73fa40ce9.zip
rpki: T3230: Fix delete section for protocol rpki
Diffstat (limited to 'scripts')
-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()