DaanHoogland commented on a change in pull request #3976: Enable sending 
hypervior host name via metadata - VR and Config Drive
URL: https://github.com/apache/cloudstack/pull/3976#discussion_r399311522
 
 

 ##########
 File path: 
server/src/main/java/com/cloud/network/element/CloudZonesNetworkElement.java
 ##########
 @@ -217,11 +220,12 @@ public boolean addPasswordAndUserdata(Network network, 
NicProfile nic, VirtualMa
             }
             String serviceOffering = 
_serviceOfferingDao.findByIdIncludingRemoved(uservm.getServiceOfferingId()).getDisplayText();
             String zoneName = 
_dcDao.findById(network.getDataCenterId()).getName();
-
+            final Account caller = CallContext.current().getCallingAccount();
+            String destHostname = 
(VirtualMachineManager.AllowExposeHypervisorHostname.value() && 
VirtualMachineManager.AllowExposeHypervisorHostnameAccountLevel.valueIn(caller.getId()))
 ? dest.getHost().getName() : null;
 
 Review comment:
   again, no override but a double condition. It also constitutes double code, 
this is a value that should be returned by the VirtualMachineManager and not be 
implemented in two places, obviously. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to