ofri masad has uploaded a new change for review.

Change subject: core: Cleanup and text fix (#838589)
......................................................................

core: Cleanup and text fix (#838589)

https://bugzilla.redhat.com/838589

Indentation and format were fixed.

Text in AuditLog was shortend and fixed.

Change-Id: I258fd187469c823f28009b7769775c182c00bac3
Signed-off-by: Ofri Masad <oma...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/quota/QuotaManager.java
M 
backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
2 files changed, 42 insertions(+), 43 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/65/7365/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/quota/QuotaManager.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/quota/QuotaManager.java
index 41a625a..9fa5c56 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/quota/QuotaManager.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/quota/QuotaManager.java
@@ -45,8 +45,8 @@
     }
 
     private AuditLogableBase getLoggableQuotaStorageParams(String quotaName,
-                                                           double 
storageUsagePercentage,
-                                                           double 
storageRequestedPercentage) {
+            double storageUsagePercentage,
+            double storageRequestedPercentage) {
         AuditLogableBase logable = new AuditLogableBase();
         logable.AddCustomValue("QuotaName", quotaName);
         logable.AddCustomValue("CurrentStorage", 
percentageFormatter.format(storageUsagePercentage));
@@ -56,30 +56,29 @@
     }
 
     private AuditLogableBase getLogableQuotaVdsGroupParams(String quotaName,
-                                                           double 
cpuCurrentPercentage,
-                                                           double 
cpuRequestPercentage,
-                                                           double 
memCurrentPercentage,
-                                                           double 
memRequestPercentage,
-                                                           boolean 
cpuOverLimit,
-                                                           boolean 
memOverLimit) {
+            double cpuCurrentPercentage,
+            double cpuRequestPercentage,
+            double memCurrentPercentage,
+            double memRequestPercentage,
+            boolean cpuOverLimit,
+            boolean memOverLimit) {
 
         AuditLogableBase logable = new AuditLogableBase();
         logable.AddCustomValue("QuotaName", quotaName);
 
         StringBuilder currentUtilization = new StringBuilder();
-        if (cpuOverLimit){
+        if (cpuOverLimit) {
             
currentUtilization.append("vcpu:").append(percentageFormatter.format(cpuCurrentPercentage)).append("%
 ");
         }
         if (memOverLimit) {
             
currentUtilization.append("mem:").append(percentageFormatter.format(memCurrentPercentage)).append("%");
         }
 
-
         StringBuilder request = new StringBuilder();
-        if (cpuOverLimit){
+        if (cpuOverLimit) {
             
request.append("vcpu:").append(percentageFormatter.format(cpuRequestPercentage)).append("%
 ");
         }
-        if (memOverLimit){
+        if (memOverLimit) {
             
request.append("mem:").append(percentageFormatter.format(memRequestPercentage)).append("%");
         }
 
@@ -90,8 +89,8 @@
     }
 
     public boolean validateAndSetStorageQuota(storage_pool storagePool,
-                                              
List<StorageQuotaValidationParameter> parameters,
-                                              ArrayList<String> 
canDoActionMessages) {
+            List<StorageQuotaValidationParameter> parameters,
+            ArrayList<String> canDoActionMessages) {
         lock.readLock().lock();
         try {
             return validateAndSetStorageQuotaHelper(storagePool, parameters, 
canDoActionMessages, true);
@@ -122,7 +121,7 @@
     }
 
     public void decreaseStorageQuota(storage_pool storagePool,
-                                     List<StorageQuotaValidationParameter> 
parameters) {
+            List<StorageQuotaValidationParameter> parameters) {
         lock.readLock().lock();
         try {
             if (!storagePoolQuotaMap.containsKey(storagePool.getId())) {
@@ -143,8 +142,8 @@
     }
 
     private boolean validateAndSetStorageQuotaHelper(storage_pool storagePool,
-                                                     
List<StorageQuotaValidationParameter> parameters,
-                                                     ArrayList<String> 
canDoActionMessages, boolean isIncrease) {
+            List<StorageQuotaValidationParameter> parameters,
+            ArrayList<String> canDoActionMessages, boolean isIncrease) {
         Pair<AuditLogType, AuditLogableBase> logPair = new Pair<AuditLogType, 
AuditLogableBase>();
         lock.readLock().lock();
         try {
@@ -295,12 +294,12 @@
     }
 
     private boolean checkQuotaStorageLimits(QuotaEnforcementTypeEnum 
quotaEnforcementTypeEnum,
-                                            Quota quota,
-                                            double limit,
-                                            double storageUsagePercentage,
-                                            double storageRequestPercentage,
-                                            ArrayList<String> 
canDoActionMessages,
-                                            Pair<AuditLogType, 
AuditLogableBase> log) {
+            Quota quota,
+            double limit,
+            double storageUsagePercentage,
+            double storageRequestPercentage,
+            ArrayList<String> canDoActionMessages,
+            Pair<AuditLogType, AuditLogableBase> log) {
         double storageTotalPercentage = storageUsagePercentage + 
storageRequestPercentage;
 
         if (limit == UNLIMITED || storageTotalPercentage <= 
quota.getThresholdStoragePercentage()) {
@@ -329,12 +328,12 @@
     }
 
     private boolean checkQuotaClusterLimits(QuotaEnforcementTypeEnum 
quotaEnforcementTypeEnum,
-                                            Quota quota,
-                                            QuotaVdsGroup quotaVdsGroup,
-                                            long memToAdd,
-                                            int vcpuToAdd,
-                                            ArrayList<String> 
canDoActionMessages,
-                                            Pair<AuditLogType, 
AuditLogableBase> log) {
+            Quota quota,
+            QuotaVdsGroup quotaVdsGroup,
+            long memToAdd,
+            int vcpuToAdd,
+            ArrayList<String> canDoActionMessages,
+            Pair<AuditLogType, AuditLogableBase> log) {
         if (quotaVdsGroup.getVirtualCpu() == 0 || quotaVdsGroup.getMemSizeMB() 
== 0) {
             return false;
         }
@@ -408,9 +407,9 @@
     }
 
     public boolean validateQuotaForStoragePool(storage_pool storagePool,
-                                               Guid vdsGroupId,
-                                               Guid quotaId,
-                                               ArrayList<String> 
canDoActionMessages) {
+            Guid vdsGroupId,
+            Guid quotaId,
+            ArrayList<String> canDoActionMessages) {
         lock.readLock().lock();
         try {
             if 
(QuotaEnforcementTypeEnum.DISABLED.equals(storagePool.getQuotaEnforcementType()))
 {
@@ -468,11 +467,11 @@
     }
 
     public boolean validateAndSetClusterQuota(storage_pool storagePool,
-                                              Guid vdsGroupId,
-                                              Guid quotaId,
-                                              int vcpu,
-                                              long mem,
-                                              ArrayList<String> 
canDoActionMessages) {
+            Guid vdsGroupId,
+            Guid quotaId,
+            int vcpu,
+            long mem,
+            ArrayList<String> canDoActionMessages) {
         Pair<AuditLogType, AuditLogableBase> logPair = new Pair<AuditLogType, 
AuditLogableBase>();
         try {
             if 
(QuotaEnforcementTypeEnum.DISABLED.equals(storagePool.getQuotaEnforcementType()))
 {
diff --git 
a/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
 
b/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
index 2517f48..c35f318 100644
--- 
a/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
+++ 
b/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
@@ -105,12 +105,12 @@
 USER_FAILED_UPDATE_QUOTA=Failed to update Quota ${QuotaName}. The operation 
was initiated by ${UserName}..
 USER_DELETE_QUOTA=Quota ${QuotaName} has been deleted by ${UserName}.
 USER_FAILED_DELETE_QUOTA=Failed to delete Quota ${QuotaName}. The operation 
was initiated by ${UserName}..
-USER_EXCEEDED_QUOTA_VDS_GROUP_GRACE_LIMIT=Cluster Quota ${QuotaName} reached 
grace limitation and blocked operation. Current utilization: ${Utilization}, 
Requested: ${Requested} - Please select a different quota or contact your 
administrator to extend the the quota.
-USER_EXCEEDED_QUOTA_VDS_GROUP_LIMIT=Cluster Quota ${QuotaName} was exceeded 
and entered the grace zone. Current utilization: ${Utilization} (It is advised 
to select a different quota or contact your administrator to extend the the 
quota).
-USER_EXCEEDED_QUOTA_VDS_GROUP_THRESHOLD=Cluster Quota ${QuotaName} is about to 
be exceeded . Current utilization: ${Utilization}
-USER_EXCEEDED_QUOTA_STORAGE_GRACE_LIMIT=Storage Quota ${QuotaName} reached 
grace limitation and blocked operation. Current utilization: storage 
${CurrentStorage}%, Requested: ${Requested}% - Please select a different quota 
or contact your administrator to extend the the quota.
-USER_EXCEEDED_QUOTA_STORAGE_LIMIT=Storage Quota ${QuotaName} was exceeded and 
entered the grace zone. Current utilization: storage ${CurrentStorage}% (It is 
advised to select a different quota or contact your administrator to extend the 
the quota).
-USER_EXCEEDED_QUOTA_STORAGE_THRESHOLD=Storage Quota ${QuotaName} is about to 
be exceeded. Current utilization: storage ${CurrentStorage}
+USER_EXCEEDED_QUOTA_VDS_GROUP_GRACE_LIMIT=Cluster Quota ${QuotaName} exceeded 
and blocked operation. Current utilization: ${Utilization}, Requested: 
${Requested} - Please select a different quota or contact your administrator to 
extend the the quota.
+USER_EXCEEDED_QUOTA_VDS_GROUP_LIMIT=Cluster Quota ${QuotaName} exceeded and 
entered the grace zone. Current utilization: ${Utilization} (It is advised to 
select a different quota or contact your administrator to extend the the quota).
+USER_EXCEEDED_QUOTA_VDS_GROUP_THRESHOLD=Cluster Quota ${QuotaName} is about to 
exceed. Current utilization: ${Utilization}
+USER_EXCEEDED_QUOTA_STORAGE_GRACE_LIMIT=Storage Quota ${QuotaName} exceeded 
and blocked operation. Current utilization: storage ${CurrentStorage}%, 
Requested: ${Requested}% - Please select a different quota or contact your 
administrator to extend the the quota.
+USER_EXCEEDED_QUOTA_STORAGE_LIMIT=Storage Quota ${QuotaName} exceeded and 
entered the grace zone. Current utilization: storage ${CurrentStorage}% (It is 
advised to select a different quota or contact your administrator to extend the 
the quota).
+USER_EXCEEDED_QUOTA_STORAGE_THRESHOLD=Storage Quota ${QuotaName} is about to 
exceed. Current utilization: storage ${CurrentStorage}%
 USER_MOVED_VM=VM ${VmName} moving to Domain ${StorageDomainName} was initiated 
by ${UserName}.
 USER_MOVED_VM_FINISHED_SUCCESS=Moving VM ${VmName} to Domain 
${StorageDomainName} has been completed.
 USER_MOVED_VM_FINISHED_FAILURE=Failed to complete moving of VM ${VmName} to 
Domain ${StorageDomainName}.


--
To view, visit http://gerrit.ovirt.org/7365
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I258fd187469c823f28009b7769775c182c00bac3
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: ofri masad <oma...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to