DaanHoogland commented on code in PR #7588:
URL: https://github.com/apache/cloudstack/pull/7588#discussion_r1226290359
##########
plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java:
##########
@@ -1243,6 +1237,46 @@ public VmwareDatacenterVO
addVmwareDatacenter(AddVmwareDcCmd cmd) throws Resourc
return vmwareDc;
}
+ VmwareDatacenterVO createOrUpdateDc(String guid, String name, String host,
String user, String password) {
+ VmwareDatacenterVO vmwareDc = new VmwareDatacenterVO(guid, name, host,
user, password);
+ // Add DC to database into vmware_data_center table
+ try {
+ vmwareDc = vmwareDcDao.persist(vmwareDc);
+ } catch (EntityExistsException e) {
+ // if that fails just get the record as is
+ vmwareDc = vmwareDcDao.getVmwareDatacenterByGuid(guid);
+ // we could now update:
+// vmwareDc.setPassword(password);
+// vmwareDc.setUser(user);
+// vmwareDc.setVmwareDatacenterName(name);
+// vmwareDc.setVcenterHost(host);
+// vmwareDcDao.update(vmwareDc.getId(), vmwareDc);
+ // but let's assume user error for now
Review Comment:
```suggestion
// we could now update the `vmwareDC` with the user supplied
`password`, `user`, `name` and `host`,
// but let's assume user error for now
```
I must say that I like my original comment better, but how about this,
@shwstppr ?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]