From 58c26ee128ed0c243e47db884ee4359c19c4abf5 Mon Sep 17 00:00:00 2001 From: Kelven Yang Date: Tue, 4 Feb 2014 16:34:40 -0800 Subject: [PATCH] return the correct NicProfile after job completion for VPC AddVmToNetwork command --- .../src/com/cloud/vm/VirtualMachineManagerImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java index e7e49b8119f..69f92c9a655 100755 --- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java +++ b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java @@ -3276,8 +3276,8 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac throw (RuntimeException)jobException; else if (jobException instanceof Throwable) throw new RuntimeException("Unexpected exception", (Throwable)jobException); - else if (jobException instanceof Long) - return requested; + else if (jobException instanceof NicProfile) + return (NicProfile)jobException; } throw new RuntimeException("Unexpected job execution result"); @@ -5006,7 +5006,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac NicProfile nic = orchestrateAddVmToNetwork(vm, network, work.getRequestedNicProfile()); - return new Pair(JobInfo.Status.SUCCEEDED, _jobMgr.marshallResultObject(nic.getId())); + return new Pair(JobInfo.Status.SUCCEEDED, _jobMgr.marshallResultObject(nic)); } private Pair orchestrateRemoveNicFromVm(VmWorkRemoveNicFromVm work) throws Exception {