Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
address comments and cleanup
  • Loading branch information
Pearl1594 committed Oct 23, 2023
commit 1f90b12fc2c97a08d005ed3bd1a048046e6f6275
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,7 @@ public class ApiConstants {
public static final String SOURCE_NAT_IP_ID = "sourcenatipaddressid";
public static final String HAS_RULES = "hasrules";

public static final String nsxDetail = "forNsx";
public static final String NSX_DETAIL_KEY = "forNsx";

/**
* This enum specifies IO Drivers, each option controls specific policies on I/O.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,5 +285,3 @@ GROUP BY

-- Set removed state for all removed accounts
UPDATE `cloud`.`account` SET state='removed' WHERE `removed` IS NOT NULL;

--
2 changes: 1 addition & 1 deletion server/src/main/java/com/cloud/api/ApiResponseHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,7 @@ public VlanIpRangeResponse createVlanIpRangeResponse(Class<? extends VlanIpRange
}
}
vlanResponse.setForSystemVms(isForSystemVms(vlan.getId()));
VlanDetailsVO vlanDetail = vlanDetailsDao.findDetail(vlan.getId(), ApiConstants.nsxDetail);
VlanDetailsVO vlanDetail = vlanDetailsDao.findDetail(vlan.getId(), ApiConstants.NSX_DETAIL_KEY);
vlanResponse.setForNsx(Objects.nonNull(vlanDetail) && vlanDetail.getValue().equals("true"));
vlanResponse.setObjectName("vlan");
return vlanResponse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4898,7 +4898,7 @@ private void checkZoneVlanIpOverlap(DataCenterVO zone, Network network, String n
continue;
}
// from here, subnet overlaps
VlanDetailsVO vlanDetail = vlanDetailsDao.findDetail(vlan.getId(), ApiConstants.nsxDetail);
VlanDetailsVO vlanDetail = vlanDetailsDao.findDetail(vlan.getId(), ApiConstants.NSX_DETAIL_KEY);
if ((Objects.isNull(vlanId) && Objects.nonNull(vlanDetail) && vlanDetail.getValue().equals("true")) || Objects.nonNull(vlanId) &&
(vlanId.toLowerCase().contains(Vlan.UNTAGGED) || UriUtils.checkVlanUriOverlap(
BroadcastDomainType.getValue(BroadcastDomainType.fromString(vlanId)),
Expand Down Expand Up @@ -4954,7 +4954,7 @@ public VlanVO doInTransaction(final TransactionStatus status) {
VlanVO vlan = new VlanVO(vlanType, vlanId, vlanGateway, vlanNetmask, zone.getId(), ipRange, networkId, physicalNetworkId, vlanIp6Gateway, vlanIp6Cidr, ipv6Range);
s_logger.debug("Saving vlan range " + vlan);
vlan = _vlanDao.persist(vlan);
vlanDetailsDao.addDetail(vlan.getId(), ApiConstants.nsxDetail, String.valueOf(forNsx), true);
vlanDetailsDao.addDetail(vlan.getId(), ApiConstants.NSX_DETAIL_KEY, String.valueOf(forNsx), true);

// IPv6 use a used ip map, is different from ipv4, no need to save
// public ip range
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.apache.cloudstack.networkoffering;

import com.cloud.configuration.ConfigurationManager;
import com.cloud.dc.dao.VlanDetailsDao;
import com.cloud.event.dao.UsageEventDao;
import com.cloud.event.dao.UsageEventDetailsDao;
import com.cloud.exception.InvalidParameterValueException;
Expand Down Expand Up @@ -100,6 +101,8 @@ public class CreateNetworkOfferingTest extends TestCase {

@Inject
AnnotationDao annotationDao;
@Inject
VlanDetailsDao vlanDetailsDao;

@Override
@Before
Expand Down
1 change: 1 addition & 0 deletions server/src/test/resources/createNetworkOffering.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,5 @@
<bean id="configurationGroupDaoImpl" class="org.apache.cloudstack.framework.config.dao.ConfigurationGroupDaoImpl" />
<bean id="configurationSubGroupDaoImpl" class="org.apache.cloudstack.framework.config.dao.ConfigurationSubGroupDaoImpl" />
<bean id="nsxControllerDaoImpl" class="com.cloud.network.dao.NsxProviderDaoImpl" />
<bean id="vlanDetailsDao" class="com.cloud.dc.dao.VlanDetailsDaoImpl" />
</beans>
1 change: 0 additions & 1 deletion ui/src/views/infra/zone/IpAddressRangeForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ export default {
const prefilledIpRangesKey = this.traffic + '-ipranges'
if (this.prefillContent[prefilledIpRangesKey]) {
this.ipRanges = this.prefillContent[prefilledIpRangesKey]
console.log(this.ipRanges)
}
},
created () {
Expand Down
16 changes: 0 additions & 16 deletions ui/src/views/infra/zone/ZoneWizardLaunchZone.vue
Original file line number Diff line number Diff line change
Expand Up @@ -905,8 +905,6 @@ export default {

let stopNow = false
this.stepData.returnedPublicTraffic = this.stepData?.returnedPublicTraffic || []
console.log(this.prefillContent['public-ipranges'])
console.log('pir')
for (let index = 0; index < this.prefillContent['public-ipranges'].length; index++) {
const publicVlanIpRange = this.prefillContent['public-ipranges'][index]
let isExisting = false
Expand Down Expand Up @@ -952,40 +950,29 @@ export default {
}

try {
console.log('is nsx zone: ', this.stepData.isNsxZone)
// for not add vlan ; next phase add the check: && this.stepData.isNsxZone
if (!this.stepData.stepMove.includes('createPublicVlanIpRange' + index)) {
console.log('create vlan ip range:')
console.log(params)
const vlanIpRangeItem = await this.createVlanIpRange(params)
this.stepData.returnedPublicTraffic.push(vlanIpRangeItem)
console.log('create public vlan ip range')
this.stepData.stepMove.push('createPublicVlanIpRange' + index)
}
} catch (e) {
console.log('error')
this.messageError = e
this.processStatus = STATUS_FAILED
this.setStepStatus(STATUS_FAILED)
stopNow = true
}
console.log('added public vlan range')

if (stopNow) {
console.log('stop now - break')
break
}
}

if (stopNow) {
console.log('stop now - return')
return
}

if (this.stepData.isTungstenZone) {
await this.stepCreateTungstenFabricPublicNetwork()
} else if (this.stepData.isNsxZone) {
console.log('added nsx controller')
await this.stepAddNsxController()
} else {
await this.stepConfigureStorageTraffic()
Expand All @@ -1002,7 +989,6 @@ export default {
if (storageExists && storageExists.length > 0) {
await this.stepConfigureStorageTraffic()
} else {
console.log('conf guest traffic')
await this.stepConfigureGuestTraffic()
}
}
Expand Down Expand Up @@ -2072,8 +2058,6 @@ export default {
createVlanIpRange (args) {
return new Promise((resolve, reject) => {
let message = ''
console.log('args:')
console.log(args)

api('createVlanIpRange', args).then(json => {
const item = json.createvlaniprangeresponse.vlan
Expand Down