Merge branch '4.9'

This commit is contained in:
Rohit Yadav 2016-12-09 00:27:11 +05:30
commit 01ec8e67b1
No known key found for this signature in database
GPG Key ID: 484248210EE3D884
2 changed files with 58 additions and 52 deletions

View File

@ -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());
//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(4, acct.getRoleId());
}
pstmt.setLong(5, acct.getDomainId()); pstmt.setLong(5, acct.getDomainId());
Date removed = acct.getRemoved(); Date removed = acct.getRemoved();

View File

@ -310,7 +310,6 @@
}; };
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({ $.ajax({
@ -373,7 +372,6 @@
} }
}); });
} }
}
} else { } else {
fields = { fields = {
label: { label: {