Github user sureshanaparti commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/1862#discussion_r94206268 --- Diff: plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java --- @@ -5620,4 +5623,39 @@ private String getAbsoluteVmdkFile(VirtualDisk disk) { } return vmdkAbsFile; } + + protected File getSystemVmKeyFile() { + if (s_systemVmKeyFile == null) { + syncFetchSystemVmKeyFile(); + } + return s_systemVmKeyFile; + } + + private static void syncFetchSystemVmKeyFile() { + synchronized (s_syncLockObjectFetchKeyFile) { + if (s_systemVmKeyFile == null) { + s_systemVmKeyFile = fetchSystemVmKeyFile(); + } + } + } + + private static File fetchSystemVmKeyFile() { + String filePath = s_relativePathSystemVmKeyFileInstallDir; + s_logger.debug("Looking for file [" + filePath + "] in the classpath."); + URL url = Script.class.getClassLoader().getResource(filePath); + File keyFile = null; + if (url != null) { + keyFile = new File(url.getPath()); + } + if (keyFile == null || !keyFile.exists()) { + filePath = s_defaultPathSystemVmKeyFile; + keyFile = new File(filePath); + s_logger.debug("Looking for file [" + filePath + "] in the classpath."); + } + assert (keyFile != null); --- End diff -- This assert statement is always true. Not needed here. Rest code changes LGTM.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---