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


##########
ui/src/views/infra/zone/ZoneWizardLaunchZone.vue:
##########
@@ -835,7 +835,7 @@ export default {
 
       const params = {}
       params.zoneId = this.stepData.zoneReturned.id
-      params.name = this.prefillContent?.podName || 
this.stepData.zoneReturned.type === 'Edge' ? 'Pod-' + 
this.stepData.zoneReturned.name : null
+      params.name = this.prefillContent?.podName || this.isEdgeZone ? 'Pod-' + 
this.stepData.zoneReturned.name : null

Review Comment:
   ```suggestion
         params.name = this.prefillContent?.podName || null
         if (this.isEdgeZone) {
           params.name =  'Pod-' + this.stepData.zoneReturned.name
         }      
   ```



##########
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:
   Do we need this?
   Shouldn't we first check for existing entry and create a new only if doesn't 
exist



##########
server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java:
##########
@@ -2510,6 +2508,12 @@ public Boolean doInTransaction(final TransactionStatus 
status) {
                 for (final VlanVO vlan : vlans) {
                     _vlanDao.remove(vlan.getId());
                 }
+                // we should actually
+//                VmwareDatacenterZoneMapVO vmwareZoneMapping = 
_vmwareDatacenterZoneMapDao.findByZoneId(zoneId)
+//                if (vmwareZoneMapping != null) {
+//                    
_vmwareDatacenterZoneMapDao.removeByZoneId(vmwareZoneMapping.getId());
+//                }
+                // but we don't know about vmware/plugin/hypervisors at this 
point

Review Comment:
   Is this needed?



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