Martin Peřina has uploaded a new change for review.

Change subject: code: Display error when kdump detection enabled, but not 
configured
......................................................................

code: Display error when kdump detection enabled, but not configured

Display error after host status was changed to Up when kdump detection is
enabled for host, but fence_kdump is not configured properly
(configuration status is updated during getVdsCaps).

Change-Id: Iecf53614d4ac9cf08bf1df5ee69f4082083c1101
Bug-Url: https://bugzilla.redhat.com/1079821
Signed-off-by: Martin Perina <mper...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/InitVdsOnUpCommand.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java
M 
backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
3 files changed, 16 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/91/28591/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/InitVdsOnUpCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/InitVdsOnUpCommand.java
index d95fdf4..1989350 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/InitVdsOnUpCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/InitVdsOnUpCommand.java
@@ -20,6 +20,7 @@
 import org.ovirt.engine.core.common.businessentities.AttestationResultEnum;
 import org.ovirt.engine.core.common.businessentities.FenceActionType;
 import org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue;
+import org.ovirt.engine.core.common.businessentities.KdumpStatus;
 import org.ovirt.engine.core.common.businessentities.NonOperationalReason;
 import org.ovirt.engine.core.common.businessentities.StorageDomain;
 import org.ovirt.engine.core.common.businessentities.StorageDomainStatic;
@@ -116,8 +117,7 @@
 
         boolean initSucceeded = true;
 
-        // host is UP, remove kdump status
-        getDbFacade().getVdsKdumpStatusDao().remove(getVdsId());
+        initHostKdumpDetectionStatus();
 
         /* Host is UP, re-set the policy controlled power management flag */
         getVds().setPowerManagementControlledByPolicy(true);
@@ -535,4 +535,16 @@
             return false;
         }
     }
+
+    private void initHostKdumpDetectionStatus() {
+        // host is UP, remove kdump status
+        getDbFacade().getVdsKdumpStatusDao().remove(getVdsId());
+
+        if (getVds().isPmKdumpDetection() &&
+                getVds().getKdumpStatus() != KdumpStatus.ENABLED) {
+            AuditLogableBase base = new AuditLogableBase();
+            base.setVds(getVds());
+            AuditLogDirector.log(base, 
AuditLogType.KDUMP_DETECTION_NOT_CONFIGURED_ON_VDS);
+        }
+    }
 }
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java
index d77a963..f2687bf 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java
@@ -115,6 +115,7 @@
     KDUMP_FLOW_DETECTED_ON_VDS(614),
     KDUMP_FLOW_NOT_DETECTED_ON_VDS(615),
     KDUMP_FLOW_FINISHED_ON_VDS(616),
+    KDUMP_DETECTION_NOT_CONFIGURED_ON_VDS(617, AuditLogSeverity.ERROR),
 
 
     HOST_REFRESHED_CAPABILITIES(606),
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 b18e44b..c0bec5a 100644
--- 
a/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
+++ 
b/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
@@ -831,4 +831,4 @@
 KDUMP_FLOW_DETECTED_ON_VDS=Kdump flow detected on host '${VdsName}'.
 KDUMP_FLOW_NOT_DETECTED_ON_VDS=Kdump flow not detected on host '${VdsName}'.
 KDUMP_FLOW_FINISHED_ON_VDS=Kdump flow finished on host '${VdsName}'.
-
+KDUMP_DETECTION_NOT_CONFIGURED_ON_VDS=Kdump detection is enabled for host 
'${VdsName}', but kdump is not configured properly on host!


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iecf53614d4ac9cf08bf1df5ee69f4082083c1101
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Martin Peřina <mper...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to