From: Michael Tremer Date: Thu, 6 Sep 2012 20:05:22 +0000 (+0000) Subject: bridge: Don't throw an assertion error when a device does not exist. X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2320875ecda510f34815371902a7379f9e4a8b38;p=people%2Fstevee%2Fnetwork.git bridge: Don't throw an assertion error when a device does not exist. If a device was supposed to be in a bridge did not exist, the bridge method threw an assertion error. --- diff --git a/functions.bridge b/functions.bridge index edf54be9..b4f41c1f 100644 --- a/functions.bridge +++ b/functions.bridge @@ -27,7 +27,11 @@ function bridge_attach_device() { assert isset device assert device_exists ${bridge} - assert device_exists ${device} + + if ! device_exists ${device}; then + log WARN "Could not attach '${device}' to '${bridge}' becase device does not exist." + return ${EXIT_ERROR} + fi # If device is already attached, exit silently if listmatch ${device} $(bridge_get_members ${bridge}); then