shwstppr commented on code in PR #7588:
URL: https://github.com/apache/cloudstack/pull/7588#discussion_r1226155529


##########
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:
   I feel a single-line comment would also work. To me, this still feels like 
commented-out code 



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

Reply via email to