Bug where pxebr was checking for link state UP before the subinterface
was added to the bridge. Moved the check to be after. Added a short
sleep in between issuing the link up and checking link status.
JIRA: OCTO-109
Change-Id: I7f782a35adf49b0da675e932d109c41b26016a5b
Signed-off-by: Tim Rozet <trozet@redhat.com>
(cherry picked from commit
87157c0dc9bd2a3da709d1cf980cce2e9c5469a3)
if [[ ${link_state} != 'UP' ]]; then
echo "${blue}${interface} state is ${link_state}. Bringing it UP!${reset}"
ip link set dev ${interface} up
if [[ ${link_state} != 'UP' ]]; then
echo "${blue}${interface} state is ${link_state}. Bringing it UP!${reset}"
ip link set dev ${interface} up
link_state=$(ip link show ${interface} | grep -oP 'state \K[^ ]+')
if [[ ${link_state} != 'UP' ]]; then
echo "${red}Could not bring UP interface ${interface} link state is ${link_state}${reset}"
link_state=$(ip link show ${interface} | grep -oP 'state \K[^ ]+')
if [[ ${link_state} != 'UP' ]]; then
echo "${red}Could not bring UP interface ${interface} link state is ${link_state}${reset}"
echo "${green}OK!${reset}"
fi
echo "${green}OK!${reset}"
fi
- #Check whether PXE bridge is UP
- check_interface ${pxe_bridge}
-
#Add VLAN 0 (PXE) interface to PXE bridge
echo "${blue}Checking whether VLAN 0 (PXE) interface ${pxe_interface} is added to PXE bridge ${pxe_bridge} exists${reset}"
if ! brctl show ${pxe_bridge} 2>&1 | grep ${pxe_interface}; then
#Add VLAN 0 (PXE) interface to PXE bridge
echo "${blue}Checking whether VLAN 0 (PXE) interface ${pxe_interface} is added to PXE bridge ${pxe_bridge} exists${reset}"
if ! brctl show ${pxe_bridge} 2>&1 | grep ${pxe_interface}; then
echo "${green}OK!${reset}"
fi
echo "${green}OK!${reset}"
fi
+ #Check whether PXE bridge is UP
+ check_interface ${pxe_bridge}
+
#Add Fuel Gateway IP Address to PXE bridge
echo "${blue}Checking whether Fuel Gateway IP Address ${fuel_gw_ip} is assigned to PXE bridge ${pxe_bridge}${reset}"
if ! ip addr show ${pxe_bridge} | grep ${fuel_gw_ip}; then
#Add Fuel Gateway IP Address to PXE bridge
echo "${blue}Checking whether Fuel Gateway IP Address ${fuel_gw_ip} is assigned to PXE bridge ${pxe_bridge}${reset}"
if ! ip addr show ${pxe_bridge} | grep ${fuel_gw_ip}; then