From e608cca2b904cb4dc0e8589bae1611a41fe4570d Mon Sep 17 00:00:00 2001 From: Tino Vazquez Date: Thu, 20 Jun 2013 17:01:17 +0200 Subject: [PATCH] feature #2097: Fine tune new VMware net drivers (cherry picked from commit 9b959b8af3c282de98f43e624fee606aea721551) --- src/vnm_mad/remotes/vmware/VMware.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vnm_mad/remotes/vmware/VMware.rb b/src/vnm_mad/remotes/vmware/VMware.rb index 449d1065c3..6655e133f1 100644 --- a/src/vnm_mad/remotes/vmware/VMware.rb +++ b/src/vnm_mad/remotes/vmware/VMware.rb @@ -42,7 +42,7 @@ class OpenNebulaVMware < OpenNebulaNetwork XPATH_FILTER = "TEMPLATE/NIC" VCLI_CMD = "/sbin/esxcfg-vswitch" - def initialize(vm, host, deploy_id = nil, hypervisor = nil) + def initialize(vm, deploy_id = nil, hypervisor = nil) super(vm,XPATH_FILTER,deploy_id,hypervisor) @locking = false @@ -80,10 +80,10 @@ class OpenNebulaVMware < OpenNebulaNetwork def add_pg_to_switch(host, pg, switch, vlan) # Check's first if the vSwitch exists add_pg_cmd = "((esxcfg-vswitch vSwitch0 -l|grep #{pg})" - add_pg_cmd += "&& #{VCLI_CMD} #{switch} --add-pg #{pg})" + add_pg_cmd += " || #{VCLI_CMD} #{switch} --add-pg #{pg})" if vlan - add_pg_cmd = "; #{VCLI_CMD} #{switch} -p #{pg} --vlan=#{vlan}" + add_pg_cmd += "; #{VCLI_CMD} #{switch} -p #{pg} --vlan=#{vlan}" end do_ssh_action(add_pg_cmd, host)