]> git.ipfire.org Git - people/stevee/network.git/commitdiff
Drop port_get_parents function
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 10 Aug 2017 21:42:37 +0000 (23:42 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 10 Aug 2017 21:42:37 +0000 (23:42 +0200)
This does not do anything useful

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/functions/functions.ports

index c852a53ae8a6e7fa064225201278ce894fe8d484..af50ee2a3c2616c79196146c2af3dbba32e2a67c 100644 (file)
@@ -174,9 +174,6 @@ port_destroy() {
                return ${EXIT_ERROR}
        fi
 
-       # Check if the port is attached to any zone and don't delete it.
-       local ok=${EXIT_OK}
-
        local attached_zone=$(port_is_attached ${port})
        if [ -n "${attached_zone}" ]; then
                if ! zone_port_detach "${attached_zone}" "${port}"; then
@@ -191,22 +188,12 @@ port_destroy() {
        for other_port in $(ports_get); do
                [ "${other_port}" = "${port}" ] && continue
 
-               if list_match ${port} $(port_get_parents ${other_port}); then
-                       error_log "Cannot destroy port '${port}' which is a parent port to '${other_port}'."
-                       ok=${EXIT_ERROR}
-               fi
-
                if list_match ${port} $(port_get_children ${other_port}); then
-                       error_log "Cannot destroy port '${port}' which is child of port '${other_port}'."
-                       ok=${EXIT_ERROR}
+                       log ERROR "Cannot destroy port '${port}' which is child of port '${other_port}'."
+                       return ${EXIT_ERROR}
                fi
        done
 
-       # If ok says we are not okay --> exit
-       if [ ${ok} -ne ${EXIT_OK} ]; then
-               return ${EXIT_ERROR}
-       fi
-
        port_remove "${port}"
 
        rm -rf $(port_dir ${port})
@@ -326,12 +313,6 @@ port_get_info() {
        )
 }
 
-port_get_parents() {
-       local port=${1}
-
-       port_get_info ${port} PORT_PARENTS
-}
-
 port_get_children() {
        local port=${1}