baremetal: Allow BM_SECOND_MAC to be unset

Currently DevStack registers the second nic of the baremetal
node even if BM_SECOND_MAC is not set or empty. However
an interface with an empty mac address causes dhcp to fail
(bug 1238595). And such operation will get to return a error
after the bug is resolved. So we should not register the
second nic if BM_SECOND_MAC is not set.

Related-Bug: #1238595
Change-Id: Ib3cc77686b72311403ccacbd70ae9cf43e6eb4c9
This commit is contained in:
Arata Notsu 2013-10-11 21:56:56 +09:00
parent 67f7da2de2
commit af15d35414

View File

@ -449,8 +449,10 @@ function add_baremetal_node() {
"$mac_1" \
| grep ' id ' | get_field 2 )
[ $? -eq 0 ] || [ "$id" ] || die $LINENO "Error adding baremetal node"
id2=$(nova baremetal-interface-add "$id" "$mac_2" )
[ $? -eq 0 ] || [ "$id2" ] || die $LINENO "Error adding interface to barmetal node $id"
if [ -n "$mac_2" ]; then
id2=$(nova baremetal-interface-add "$id" "$mac_2" )
[ $? -eq 0 ] || [ "$id2" ] || die $LINENO "Error adding interface to barmetal node $id"
fi
}