bug 9242: add vlan dependence for ubuntu, and set name type to DEV_PLUS_VID_NO_PAD, before creating vlan

status 9242: resolved fixed
This commit is contained in:
Edison Su 2011-03-31 19:08:14 -04:00
parent 8b3e22e84c
commit 159f52c2ff
2 changed files with 9 additions and 7 deletions

2
debian/control vendored
View File

@ -141,7 +141,7 @@ Provides: vmops-agent
Conflicts: vmops-agent
Replaces: vmops-agent
Architecture: any
Depends: openjdk-6-jre, cloud-utils (= ${source:Version}), cloud-core (= ${source:Version}), cloud-deps (= ${source:Version}), python, cloud-python (= ${source:Version}), cloud-agent-libs (= ${source:Version}), cloud-agent-scripts (= ${source:Version}), libcommons-httpclient-java, libcommons-collections-java, libcommons-dbcp-java, libcommons-pool-java, libcommons-logging-java, libvirt0, cloud-daemonize, sysvinit-utils, chkconfig, qemu-kvm, libvirt-bin, cgroup-bin, augeas-tools, uuid-runtime, rsync, grep, iproute
Depends: openjdk-6-jre, cloud-utils (= ${source:Version}), cloud-core (= ${source:Version}), cloud-deps (= ${source:Version}), python, cloud-python (= ${source:Version}), cloud-agent-libs (= ${source:Version}), cloud-agent-scripts (= ${source:Version}), libcommons-httpclient-java, libcommons-collections-java, libcommons-dbcp-java, libcommons-pool-java, libcommons-logging-java, libvirt0, cloud-daemonize, sysvinit-utils, chkconfig, qemu-kvm, libvirt-bin, cgroup-bin, augeas-tools, uuid-runtime, rsync, grep, iproute, vlan
Description: Cloud.com agent
The Cloud.com agent is in charge of managing shared computing resources in
a Cloud.com Cloud Stack-powered cloud. Install this package if this computer

View File

@ -15,19 +15,21 @@ addVlan() {
local pif=$2
local vlanDev=$pif.$vlanId
local vlanBr=$VIRBR$vlanId
vconfig set_name_type DEV_PLUS_VID_NO_PAD
if [ ! -d /sys/class/net/$vlanDev ]
then
vconfig add $pif $vlanId > /dev/null
if [ $? -gt 0 ]
then
# race condition that someone already creates the vlan
# race condition that someone already creates the vlan
if [ ! -d /sys/class/net/$vlanDev ]
then
printf "Failed to create vlan $vlanId on pif: $pif."
return 1
fi
then
printf "Failed to create vlan $vlanId on pif: $pif."
return 1
fi
fi
fi