From cfd13c561c160248e2a01d07da86cecb9dfb2cbe Mon Sep 17 00:00:00 2001 From: Matthew Thode Date: Mon, 24 Sep 2018 00:21:00 -0500 Subject: [PATCH] use find instead of ls to list interfaces find is used instead of ls as we can select the 'link' type with find only the link type is needed because files do not have interface properties and directories are not used for this area of /sys As an example, the bonding_masters exists in /sys/class/net/ as a file without any 'subdirectory' of information to it. Change-Id: Id31fcfb858c6abff4d44444e019f0d48e4f3c671 --- roles/multi-node-bridge/tasks/common.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/roles/multi-node-bridge/tasks/common.yaml b/roles/multi-node-bridge/tasks/common.yaml index d07e9993b..8285cc769 100644 --- a/roles/multi-node-bridge/tasks/common.yaml +++ b/roles/multi-node-bridge/tasks/common.yaml @@ -72,8 +72,11 @@ # created through this system. This makes our MTU determination mostly # idempotent allowing us to create multiple overlays without # perpetually smaller MTUs. + # find is used instead of ls as we can select the 'link' type with find + # only the link type is needed because files do not have interface + # properties and directories are not used for this area of /sys SMALLEST_MTU="" - for X in $(ls /sys/class/net) ; do + for X in $(find /sys/class/net/ -maxdepth 1 -type l -exec basename {} ';') ; do MAC_TYPE=$(cat "/sys/class/net/${X}/addr_assign_type") if [ "$MAC_TYPE" -ne "0" ] ; then # Type 0 is a permanent address implying a "real"