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_r399321199
 
 

 ##########
 File path: 
server/src/main/java/com/cloud/network/element/ConfigDriveNetworkElement.java
 ##########
 @@ -514,9 +584,11 @@ private boolean configureConfigDriveData(final 
VirtualMachineProfile profile, fi
             final String sshPublicKey = getSshKey(profile);
             final String serviceOffering = 
_serviceOfferingDao.findByIdIncludingRemoved(vm.getId(), 
vm.getServiceOfferingId()).getDisplayText();
             boolean isWindows = 
_guestOSCategoryDao.findById(_guestOSDao.findById(vm.getGuestOSId()).getCategoryId()).getName().equalsIgnoreCase("Windows");
-
+            String hostname = _hostDao.findById(vm.getHostId()).getName();
+            final Account caller = CallContext.current().getCallingAccount();
+            String destHostname = 
(VirtualMachineManager.AllowExposeHypervisorHostname.value() && 
VirtualMachineManager.AllowExposeHypervisorHostnameAccountLevel.valueIn(caller.getId()))
 ? hostname : null;
 
 Review comment:
   maybe the hostname retrieval and caller account should be added inside the 
call as well.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to