Merge "tools/Xen: failed to install domU in new XenServer"

This commit is contained in:
Jenkins 2015-09-28 09:56:42 +00:00 committed by Gerrit Code Review
commit 983c07c297
2 changed files with 6 additions and 2 deletions

View File

@ -179,7 +179,8 @@ function xenapi_ip_on {
local bridge_or_net_name
bridge_or_net_name=$1
ifconfig $(bridge_for "$bridge_or_net_name") | grep "inet addr" | cut -d ":" -f2 | sed "s/ .*//"
ip -4 addr show $(bridge_for "$bridge_or_net_name") |\
awk '/inet/{split($2, ip, "/"); print ip[1];}'
}
function xenapi_is_listening_on {

View File

@ -193,7 +193,10 @@ if [ -z "$templateuuid" ]; then
TMP_DIR=/tmp/temp.$RANDOM
mkdir -p $TMP_DIR
mount -o loop $TOOLS_ISO $TMP_DIR
DEB_FILE=$(ls $TMP_DIR/Linux/*amd64.deb)
# the target deb package maybe *amd64.deb or *all.deb,
# so use *amd64.deb by default. If it doesn't exist,
# then use *all.deb.
DEB_FILE=$(ls $TMP_DIR/Linux/*amd64.deb || ls $TMP_DIR/Linux/*all.deb)
cp $DEB_FILE $HTTP_SERVER_LOCATION
umount $TMP_DIR
rmdir $TMP_DIR