Merge "xenapi: enable user to specify FLAT_NETWORK_BRIDGE"

This commit is contained in:
Jenkins 2013-11-22 13:40:04 +00:00 committed by Gerrit Code Review
commit dbb5b6cd8c
2 changed files with 11 additions and 8 deletions

View File

@ -137,14 +137,14 @@ function _network_exists() {
local name_label
name_label=$1
! [ -z $(xe network-list name-label="$name_label" --minimal) ]
! [ -z "$(xe network-list name-label="$name_label" --minimal)" ]
}
function _bridge_exists() {
local bridge
bridge=$1
! [ -z $(xe network-list bridge="$bridge" --minimal) ]
! [ -z "$(xe network-list bridge="$bridge" --minimal)" ]
}
function _network_uuid() {

View File

@ -111,12 +111,15 @@ if is_service_enabled neutron; then
fi
if parameter_is_specified "FLAT_NETWORK_BRIDGE"; then
if [ "$(bridge_for "$VM_BRIDGE_OR_NET_NAME")" != "$(bridge_for "$FLAT_NETWORK_BRIDGE")" ]; then
cat >&2 << EOF
ERROR: FLAT_NETWORK_BRIDGE is specified in localrc file
This is considered as an error, as its value will be derived from the
VM_BRIDGE_OR_NET_NAME variable's value.
ERROR: FLAT_NETWORK_BRIDGE is specified in localrc file, and either no network
found on XenServer by searching for networks by that value as name-label or
bridge name or the network found does not match the network specified by
VM_BRIDGE_OR_NET_NAME. Please check your localrc file.
EOF
exit 1
fi
fi
if ! xenapi_is_listening_on "$MGT_BRIDGE_OR_NET_NAME"; then
@ -310,7 +313,7 @@ if is_service_enabled neutron; then
"xen_integration_bridge=${XEN_INTEGRATION_BRIDGE}"
fi
FLAT_NETWORK_BRIDGE=$(bridge_for "$VM_BRIDGE_OR_NET_NAME")
FLAT_NETWORK_BRIDGE="${FLAT_NETWORK_BRIDGE:-$(bridge_for "$VM_BRIDGE_OR_NET_NAME")}"
append_kernel_cmdline "$GUEST_NAME" "flat_network_bridge=${FLAT_NETWORK_BRIDGE}"
# Add a separate xvdb, if it was requested