Skip to content

Commit 1d73418

Browse files
author
Suresh Kumar Anaparti
committed
CLOUDSTACK-8820: Updated the code for vCenter6 data center support.
1 parent 4a6e2cd commit 1d73418

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareClient.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ public void connect(String url, String userName, String password) throws Excepti
156156
vimPort.login(serviceContent.getSessionManager(), userName, password, null);
157157

158158
if (cookies == null) {
159+
// Get the cookie from the response header. See vmware sample program com.vmware.httpfileaccess.GetVMFiles
159160
@SuppressWarnings("unchecked")
160161
Map<String, List<String>> responseHeaders = (Map<String, List<String>>)((BindingProvider)vimPort).getResponseContext().get(MessageContext.HTTP_RESPONSE_HEADERS);
161162
cookies = responseHeaders.get("Set-cookie");
@@ -627,9 +628,12 @@ public ManagedObjectReference getDecendentMoRef(ManagedObjectReference root, Str
627628
}
628629
}
629630
}
630-
} catch (Exception e) {
631-
s_logger.debug("Failed to get mor for name: " + name + " and type: " + type, e);
632-
throw e;
631+
} catch (InvalidPropertyFaultMsg invalidPropertyException) {
632+
s_logger.debug("Failed to get Vmware ManagedObjectReference for name: " + name + " and type: " + type + " due to " + invalidPropertyException.getMessage());
633+
throw invalidPropertyException;
634+
} catch (RuntimeFaultFaultMsg runtimeFaultException) {
635+
s_logger.debug("Failed to get Vmware ManagedObjectReference for name: " + name + " and type: " + type + " due to " + runtimeFaultException.getMessage());
636+
throw runtimeFaultException;
633637
}
634638

635639
return null;

0 commit comments

Comments
 (0)