Mike Kolesnik has uploaded a new change for review. Change subject: engine: Added audit log to update network (#846241) ......................................................................
engine: Added audit log to update network (#846241) https://bugzilla.redhat.com/846241 Added audit logging to update of network in the DC. Change-Id: I5743f143c596c1ea57e2a45c54324dbd04876d70 Signed-off-by: Mike Kolesnik <[email protected]> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/UpdateNetworkCommand.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java M backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties 4 files changed, 12 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/19/7219/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/UpdateNetworkCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/UpdateNetworkCommand.java index 281e16a..d8418e4 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/UpdateNetworkCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/UpdateNetworkCommand.java @@ -3,6 +3,7 @@ import java.util.List; import org.ovirt.engine.core.bll.AttachNetworkToVdsGroupCommand; +import org.ovirt.engine.core.common.AuditLogType; import org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters; import org.ovirt.engine.core.common.businessentities.Network; import org.ovirt.engine.core.common.businessentities.VDSGroup; @@ -126,6 +127,11 @@ } @Override + public AuditLogType getAuditLogTypeValue() { + return getSucceeded() ? AuditLogType.NETWORK_UPDATE_NETWORK : AuditLogType.NETWORK_UPDATE_NETWORK_FAILED; + } + + @Override protected List<Class<?>> getValidationGroups() { addValidationGroup(UpdateEntity.class); return super.getValidationGroups(); 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 1254232..a0ce616 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 @@ -465,6 +465,8 @@ NETWORK_ADD_NETWORK_FAILED(943), NETWORK_REMOVE_NETWORK(944), NETWORK_REMOVE_NETWORK_FAILED(945), + NETWORK_UPDATE_NETWORK(1111), + NETWORK_UPDATE_NETWORK_FAILED(1112), NETWORK_ATTACH_NETWORK_TO_VDS_GROUP(946), NETWORK_ATTACH_NETWORK_TO_VDS_GROUP_FAILED(947), NETWORK_DETACH_NETWORK_TO_VDS_GROUP(948), diff --git a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java index 7a308dd..55d7572 100644 --- a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java +++ b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java @@ -626,6 +626,8 @@ mSeverities.put(AuditLogType.NETWORK_ADD_NETWORK_FAILED, AuditLogSeverity.ERROR); mSeverities.put(AuditLogType.NETWORK_REMOVE_NETWORK, AuditLogSeverity.NORMAL); mSeverities.put(AuditLogType.NETWORK_REMOVE_NETWORK_FAILED, AuditLogSeverity.ERROR); + mSeverities.put(AuditLogType.NETWORK_UPDATE_NETWORK, AuditLogSeverity.NORMAL); + mSeverities.put(AuditLogType.NETWORK_UPDATE_NETWORK_FAILED, AuditLogSeverity.ERROR); mSeverities.put(AuditLogType.NETWORK_ATTACH_NETWORK_TO_VDS_GROUP, AuditLogSeverity.NORMAL); mSeverities.put(AuditLogType.NETWORK_ATTACH_NETWORK_TO_VDS_GROUP_FAILED, AuditLogSeverity.ERROR); mSeverities.put(AuditLogType.NETWORK_DETACH_NETWORK_TO_VDS_GROUP, AuditLogSeverity.NORMAL); 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 4d47f82..c44f225 100644 --- a/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties +++ b/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties @@ -422,6 +422,8 @@ NETWORK_UPDTAE_NETWORK_ON_CLUSTER_FAILED=Failed to update Network ${NetworkName} on Cluster ${VdsGroupName}. NETWORK_REMOVE_NETWORK=Network ${NetworkName} was removed from data center: ${StoragePoolName} NETWORK_REMOVE_NETWORK_FAILED=Failed to remove Network ${NetworkName} from data center: ${StoragePoolName} +NETWORK_UPDATE_NETWORK=Network ${NetworkName} was updated on data center: ${StoragePoolName} +NETWORK_UPDATE_NETWORK_FAILED=Failed to update Network ${NetworkName} on data center: ${StoragePoolName} NETWORK_REMOVE_TEMPLATE_INTERFACE=Interface ${InterfaceName} (${InterfaceType}) was removed from Template ${VmTemplateName}. (User: ${UserName}) NETWORK_REMOVE_TEMPLATE_INTERFACE_FAILED=Failed to remove Interface ${InterfaceName} (${InterfaceType}) from Template ${VmTemplateName}. (User: ${UserName}) NETWORK_REMOVE_VM_INTERFACE=Interface ${InterfaceName} (${InterfaceType}) was removed from VM ${VmName}. (User: ${UserName}) -- To view, visit http://gerrit.ovirt.org/7219 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5743f143c596c1ea57e2a45c54324dbd04876d70 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Mike Kolesnik <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
