mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-16 10:32:34 +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.db.TransactionStatus;
|
||||||
import com.cloud.utils.exception.CloudRuntimeException;
|
import com.cloud.utils.exception.CloudRuntimeException;
|
||||||
|
|
||||||
|
import org.apache.cloudstack.acl.RoleType;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
@ -113,7 +114,14 @@ public class UsageDaoImpl extends GenericDaoBase<UsageVO, Long> implements Usage
|
|||||||
pstmt.setLong(1, acct.getId());
|
pstmt.setLong(1, acct.getId());
|
||||||
pstmt.setString(2, acct.getAccountName());
|
pstmt.setString(2, acct.getAccountName());
|
||||||
pstmt.setShort(3, acct.getType());
|
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());
|
pstmt.setLong(5, acct.getDomainId());
|
||||||
|
|
||||||
Date removed = acct.getRemoved();
|
Date removed = acct.getRemoved();
|
||||||
|
|||||||
@ -310,69 +310,67 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
if(zoneType == 'Advanced') {
|
if(zoneType == 'Advanced') {
|
||||||
if($trafficType.hasClass('guest') || $trafficType.hasClass('public')) {
|
if(trafficData.vSwitchType == null) {
|
||||||
if(trafficData.vSwitchType == null) {
|
var useDvs = false;
|
||||||
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({
|
$.ajax({
|
||||||
url: createURL('listConfigurations'),
|
url: createURL('listConfigurations'),
|
||||||
data: {
|
data: {
|
||||||
name: 'vmware.use.dvswitch'
|
name: 'vmware.use.nexus.vswitch'
|
||||||
},
|
},
|
||||||
async: false,
|
async: false,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
if (json.listconfigurationsresponse.configuration[0].value == 'true') {
|
if (json.listconfigurationsresponse.configuration[0].value == 'true') {
|
||||||
useDvs = true;
|
useNexusDvs = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (useDvs == true) {
|
if (useNexusDvs == true) {
|
||||||
var useNexusDvs = false;
|
trafficData.vSwitchType = 'nexusdvs';
|
||||||
$.ajax({
|
fields.vSwitchName.defaultValue = 'epp0';
|
||||||
url: createURL('listConfigurations'),
|
} else {
|
||||||
data: {
|
trafficData.vSwitchType = 'vmwaredvs';
|
||||||
name: 'vmware.use.nexus.vswitch'
|
fields.vSwitchName.defaultValue = 'dvSwitch0';
|
||||||
},
|
|
||||||
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';
|
|
||||||
}
|
}
|
||||||
}
|
} else { //useDvs == false
|
||||||
|
trafficData.vSwitchType = 'vmwaresvs';
|
||||||
$.extend(fields, {
|
fields.vSwitchName.defaultValue = 'vSwitch0';
|
||||||
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
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$.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 {
|
} else {
|
||||||
fields = {
|
fields = {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user