mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-15 18:12:35 +01:00
Merge branch '4.9'
This commit is contained in:
commit
01ec8e67b1
@ -32,6 +32,7 @@ import com.cloud.utils.db.TransactionLegacy;
|
||||
import com.cloud.utils.db.TransactionStatus;
|
||||
import com.cloud.utils.exception.CloudRuntimeException;
|
||||
|
||||
import org.apache.cloudstack.acl.RoleType;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@ -113,7 +114,14 @@ public class UsageDaoImpl extends GenericDaoBase<UsageVO, Long> implements Usage
|
||||
pstmt.setLong(1, acct.getId());
|
||||
pstmt.setString(2, acct.getAccountName());
|
||||
pstmt.setShort(3, acct.getType());
|
||||
pstmt.setLong(4, acct.getRoleId());
|
||||
|
||||
//prevent autoboxing NPE by defaulting to User role
|
||||
if(acct.getRoleId() == null){
|
||||
pstmt.setLong(4, RoleType.User.getId());
|
||||
}else{
|
||||
pstmt.setLong(4, acct.getRoleId());
|
||||
}
|
||||
|
||||
pstmt.setLong(5, acct.getDomainId());
|
||||
|
||||
Date removed = acct.getRemoved();
|
||||
|
||||
@ -310,69 +310,67 @@
|
||||
};
|
||||
|
||||
if(zoneType == 'Advanced') {
|
||||
if($trafficType.hasClass('guest') || $trafficType.hasClass('public')) {
|
||||
if(trafficData.vSwitchType == null) {
|
||||
var useDvs = false;
|
||||
if(trafficData.vSwitchType == null) {
|
||||
var useDvs = false;
|
||||
$.ajax({
|
||||
url: createURL('listConfigurations'),
|
||||
data: {
|
||||
name: 'vmware.use.dvswitch'
|
||||
},
|
||||
async: false,
|
||||
success: function(json) {
|
||||
if (json.listconfigurationsresponse.configuration[0].value == 'true') {
|
||||
useDvs = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
if (useDvs == true) {
|
||||
var useNexusDvs = false;
|
||||
$.ajax({
|
||||
url: createURL('listConfigurations'),
|
||||
data: {
|
||||
name: 'vmware.use.dvswitch'
|
||||
name: 'vmware.use.nexus.vswitch'
|
||||
},
|
||||
async: false,
|
||||
success: function(json) {
|
||||
if (json.listconfigurationsresponse.configuration[0].value == 'true') {
|
||||
useDvs = true;
|
||||
useNexusDvs = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
if (useDvs == true) {
|
||||
var useNexusDvs = false;
|
||||
$.ajax({
|
||||
url: createURL('listConfigurations'),
|
||||
data: {
|
||||
name: 'vmware.use.nexus.vswitch'
|
||||
},
|
||||
async: false,
|
||||
success: function(json) {
|
||||
if (json.listconfigurationsresponse.configuration[0].value == 'true') {
|
||||
useNexusDvs = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
if (useNexusDvs == true) {
|
||||
trafficData.vSwitchType = 'nexusdvs';
|
||||
fields.vSwitchName.defaultValue = 'epp0';
|
||||
} else {
|
||||
trafficData.vSwitchType = 'vmwaredvs';
|
||||
fields.vSwitchName.defaultValue = 'dvSwitch0';
|
||||
}
|
||||
} else { //useDvs == false
|
||||
trafficData.vSwitchType = 'vmwaresvs';
|
||||
fields.vSwitchName.defaultValue = 'vSwitch0';
|
||||
if (useNexusDvs == true) {
|
||||
trafficData.vSwitchType = 'nexusdvs';
|
||||
fields.vSwitchName.defaultValue = 'epp0';
|
||||
} else {
|
||||
trafficData.vSwitchType = 'vmwaredvs';
|
||||
fields.vSwitchName.defaultValue = 'dvSwitch0';
|
||||
}
|
||||
}
|
||||
|
||||
$.extend(fields, {
|
||||
vSwitchType: {
|
||||
label: 'label.vSwitch.type',
|
||||
select: function (args) {
|
||||
args.response.success({
|
||||
data: [{
|
||||
id: 'nexusdvs',
|
||||
description: 'Cisco Nexus 1000v Distributed Virtual Switch'
|
||||
}, {
|
||||
id: 'vmwaresvs',
|
||||
description: 'VMware vNetwork Standard Virtual Switch'
|
||||
}, {
|
||||
id: 'vmwaredvs',
|
||||
description: 'VMware vNetwork Distributed Virtual Switch'
|
||||
}]
|
||||
});
|
||||
},
|
||||
defaultValue: trafficData.vSwitchType
|
||||
}
|
||||
});
|
||||
} else { //useDvs == false
|
||||
trafficData.vSwitchType = 'vmwaresvs';
|
||||
fields.vSwitchName.defaultValue = 'vSwitch0';
|
||||
}
|
||||
}
|
||||
|
||||
$.extend(fields, {
|
||||
vSwitchType: {
|
||||
label: 'label.vSwitch.type',
|
||||
select: function (args) {
|
||||
args.response.success({
|
||||
data: [{
|
||||
id: 'nexusdvs',
|
||||
description: 'Cisco Nexus 1000v Distributed Virtual Switch'
|
||||
}, {
|
||||
id: 'vmwaresvs',
|
||||
description: 'VMware vNetwork Standard Virtual Switch'
|
||||
}, {
|
||||
id: 'vmwaredvs',
|
||||
description: 'VMware vNetwork Distributed Virtual Switch'
|
||||
}]
|
||||
});
|
||||
},
|
||||
defaultValue: trafficData.vSwitchType
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
fields = {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user