From 779f4b36e03738a9eb1ffa4c474e9b4968cd7b72 Mon Sep 17 00:00:00 2001 From: Remi Bergsma Date: Thu, 31 Dec 2015 14:08:14 +0100 Subject: [PATCH] CLOUDSTACK-9204 Do not error when staticroute is already gone When deleting fails because it isn't there any morei (KeyError), it should succeed instead. --- .../patches/debian/config/opt/cloud/bin/cs_staticroutes.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs_staticroutes.py b/systemvm/patches/debian/config/opt/cloud/bin/cs_staticroutes.py index 98244db03c8..d5ffae15cbb 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/cs_staticroutes.py +++ b/systemvm/patches/debian/config/opt/cloud/bin/cs_staticroutes.py @@ -23,7 +23,10 @@ def merge(dbag, staticroutes): key = route['ip_address'] revoke = route['revoke'] if revoke: - del dbag[key] + try: + del dbag[key] + except KeyError: + pass else: dbag[key] = route