---
 lib/networktables.py |   15 +++++----------
 1 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/lib/networktables.py b/lib/networktables.py
index 5557da2..f2006e0 100644
--- a/lib/networktables.py
+++ b/lib/networktables.py
@@ -34,16 +34,11 @@ def RemoveNetworkEntry(ip_address, context, iface):
   @param iface: network interface to use
   """
 
-  # Check if the entry exists before trying to remove it. Do nothing if
-  # it doesn't exist
-  cmd_show = 'ip %s show %s dev %s' % (context, ip_address, iface)
-  result_show = utils.RunCmd(cmd_show)
-  if result_show.failed:
-    cmd = 'ip %s del %s dev %s' % (context, ip_address, iface)
-    result = utils.RunCmd(cmd)
-    if result.failed:
-      raise errors.OpExecError("Could not update table, error %s" %
-                               result.output)
+  # This command returns an error when asked to remove a non-existent
+  # address. We don't care about that, so no need to raise an error
+  # here.
+  cmd = 'ip %s del %s dev %s' % (context, ip_address, iface)
+  result = utils.RunCmd(cmd)
 
 
 def UpdateNetworkEntry(ip_address, dest_address, context, iface):
-- 
1.5.4.3

Reply via email to