shwstppr commented on a change in pull request #4385:
URL: https://github.com/apache/cloudstack/pull/4385#discussion_r527628756



##########
File path: 
vmware-base/src/main/java/com/cloud/hypervisor/vmware/util/VmwareHelper.java
##########
@@ -744,4 +744,18 @@ public static XMLGregorianCalendar 
getXMLGregorianCalendar(final Date date, fina
         return 
DatatypeFactory.newInstance().newXMLGregorianCalendar(gregorianCalendar);
     }
 
+    public static HostMO getHostMOFromHostName(final VmwareContext context, 
final String hostName) {
+        HostMO host = null;
+        if (com.cloud.utils.StringUtils.isNotBlank(hostName) && 
hostName.contains("@")) {
+            String hostMorInfo = hostName.split("@")[0];
+            if (hostMorInfo.contains(":")) {
+                ManagedObjectReference morHost = new ManagedObjectReference();
+                morHost.setType(hostMorInfo.split(":")[0]);
+                morHost.setValue(hostMorInfo.split(":")[1]);
+                host = new HostMO(context, morHost);

Review comment:
       @rhtyd did that at line 751




----------------------------------------------------------------
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]


Reply via email to