@@ -3972,7 +3972,6 @@ public NicResponse createNicResponse(Nic result) {
39723972 NicResponse response = new NicResponse ();
39733973 NetworkVO network = _entityMgr .findById (NetworkVO .class , result .getNetworkId ());
39743974 VMInstanceVO vm = _entityMgr .findById (VMInstanceVO .class , result .getInstanceId ());
3975- UserVmJoinVO userVm = _entityMgr .findById (UserVmJoinVO .class , result .getInstanceId ());
39763975 List <NicExtraDhcpOptionVO > nicExtraDhcpOptionVOs = _nicExtraDhcpOptionDao .listByNicId (result .getId ());
39773976
39783977 // The numbered comments are to keep track of the data returned from here and UserVmJoinDaoImpl.setUserVmResponse()
@@ -3986,15 +3985,13 @@ public NicResponse createNicResponse(Nic result) {
39863985 response .setVmId (vm .getUuid ());
39873986 }
39883987
3989- if (userVm != null ){
3990- if (userVm .getTrafficType () != null ) {
3991- /*4: trafficType*/
3992- response .setTrafficType (userVm .getTrafficType ().toString ());
3993- }
3994- if (userVm .getGuestType () != null ) {
3995- /*5: guestType*/
3996- response .setType (userVm .getGuestType ().toString ());
3997- }
3988+ if (network .getTrafficType () != null ) {
3989+ /*4: trafficType*/
3990+ response .setTrafficType (network .getTrafficType ().toString ());
3991+ }
3992+ if (network .getGuestType () != null ) {
3993+ /*5: guestType*/
3994+ response .setType (network .getGuestType ().toString ());
39983995 }
39993996 /*6: ipAddress*/
40003997 response .setIpaddress (result .getIPv4Address ());
@@ -4003,9 +4000,7 @@ public NicResponse createNicResponse(Nic result) {
40034000 /*8: netmask*/
40044001 response .setNetmask (result .getIPv4Netmask ());
40054002 /*9: networkName*/
4006- if (userVm != null && userVm .getNetworkName () != null ) {
4007- response .setNetworkName (userVm .getNetworkName ());
4008- }
4003+ response .setNetworkName (network .getName ());
40094004 /*10: macAddress*/
40104005 response .setMacAddress (result .getMacAddress ());
40114006 /*11: IPv6Address*/
0 commit comments