return the correct NicProfile after job completion for VPC AddVmToNetwork command

This commit is contained in:
Kelven Yang 2014-02-04 16:34:40 -08:00
parent 18b5fb5a3c
commit 58c26ee128
1 changed files with 3 additions and 3 deletions

View File

@ -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, String>(JobInfo.Status.SUCCEEDED, _jobMgr.marshallResultObject(nic.getId()));
return new Pair<JobInfo.Status, String>(JobInfo.Status.SUCCEEDED, _jobMgr.marshallResultObject(nic));
}
private Pair<JobInfo.Status, String> orchestrateRemoveNicFromVm(VmWorkRemoveNicFromVm work) throws Exception {