You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2021/01/04 05:27:13 UTC

[GitHub] [cloudstack] harikrishna-patnala commented on a change in pull request #4564: Network Offering: Allow enabling network and vpc offering during creation

harikrishna-patnala commented on a change in pull request #4564:
URL: https://github.com/apache/cloudstack/pull/4564#discussion_r551123487



##########
File path: server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java
##########
@@ -5032,8 +5032,12 @@ public NetworkOffering createNetworkOffering(final CreateNetworkOfferingCmd cmd)
             forVpc = false;
         }
 
-        final NetworkOffering offering = createNetworkOffering(name, displayText, trafficType, tags, specifyVlan, availability, networkRate, serviceProviderMap, false, guestType, false,
+        final NetworkOfferingVO offering = createNetworkOffering(name, displayText, trafficType, tags, specifyVlan, availability, networkRate, serviceProviderMap, false, guestType, false,
                 serviceOfferingId, conserveMode, serviceCapabilityMap, specifyIpRanges, isPersistent, details, egressDefaultPolicy, maxconn, enableKeepAlive, forVpc, domainIds, zoneIds);
+        if (enable) {

Review comment:
       Instead of updating the offeringVO again, pass the value of "enable" to createNetworkOffering() method and use offeringFinal.setState() method to set it while creating the initial VO entry itself.

##########
File path: server/src/main/java/com/cloud/network/vpc/VpcManagerImpl.java
##########
@@ -387,14 +387,20 @@ public VpcOffering createVpcOffering(CreateVPCOfferingCmd cmd) {
             }
         }
 
-        return createVpcOffering(vpcOfferingName, displayText, supportedServices,
+        VpcOfferingVO vpcOfferingVO = createVpcOffering(vpcOfferingName, displayText, supportedServices,
                 serviceProviderList, serviceCapabilitystList, serviceOfferingId,
                 domainIds, zoneIds);
+
+        if (enable) {

Review comment:
       same as above comment for NetworkOfferingVO. Set it while creating VO itself.




----------------------------------------------------------------
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:
users@infra.apache.org