Skip to content

Commit f8296f2

Browse files
author
Alexandru Bagu
committed
move NIC retrieval in try-catch
1 parent d3939f0 commit f8296f2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server/src/main/java/com/cloud/vm/UserVmManagerImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -763,12 +763,12 @@ public VmIpAddrFetchThread(long vmId, String vmUuid, long nicId, String instance
763763

764764
@Override
765765
protected void runInContext() {
766-
NicVO nic = _nicDao.findById(nicId);
767-
GetVmIpAddressCommand cmd = new GetVmIpAddressCommand(vmName, networkCidr, nic.getMacAddress(), isWindows);
768766
boolean decrementCount = true;
769767

770768
try {
771769
logger.debug("Trying IP retrieval for VM [id: {}, uuid: {}, name: {}], nic {}", vmId, vmUuid, vmName, nic);
770+
NicVO nic = _nicDao.findById(nicId);
771+
GetVmIpAddressCommand cmd = new GetVmIpAddressCommand(vmName, networkCidr, nic.getMacAddress(), isWindows);
772772
Answer answer = _agentMgr.send(hostId, cmd);
773773
if (answer.getResult()) {
774774
String vmIp = answer.getDetails();

0 commit comments

Comments
 (0)