Moti Asayag has uploaded a new change for review.

Change subject: engine: Add audit log messages for vnic profile commands
......................................................................

engine: Add audit log messages for vnic profile commands

The patch adds the audit log messages for the vnic profile
commands which will be created as an event log in case of
success or failure in action execution.

Change-Id: I3d41b5487faf7eafaeae0ed929fd53ad26e7416a
Signed-off-by: Moti Asayag <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/vm/VnicProfileCommon.java
M 
backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
2 files changed, 30 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/92/16892/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/vm/VnicProfileCommon.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/vm/VnicProfileCommon.java
index 1d3a389..dd51f56 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/vm/VnicProfileCommon.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/vm/VnicProfileCommon.java
@@ -7,11 +7,15 @@
 import org.ovirt.engine.core.bll.utils.PermissionSubject;
 import org.ovirt.engine.core.common.VdcObjectType;
 import org.ovirt.engine.core.common.action.VnicProfileParameters;
+import org.ovirt.engine.core.common.businessentities.network.Network;
 import org.ovirt.engine.core.common.businessentities.network.VnicProfile;
 import org.ovirt.engine.core.common.errors.VdcBllMessages;
 import org.ovirt.engine.core.compat.Guid;
 
 public abstract class VnicProfileCommon<T extends VnicProfileParameters> 
extends CommandBase<T> {
+
+    private Network network;
+
     public VnicProfileCommon(T parameters) {
         super(parameters);
     }
@@ -33,4 +37,24 @@
                 VdcObjectType.VnicProfile,
                 getActionType().getActionGroup()));
     }
+
+    public String getVnicProfileName() {
+        return getVnicProfile().getName();
+    }
+
+    public String getNetworkName() {
+        return getNetwork().getName();
+    }
+
+    public String getDataCenterName() {
+        return 
getStoragePoolDAO().get(getNetwork().getDataCenterId()).getName();
+    }
+
+    private Network getNetwork() {
+        if (network == null) {
+            network = getNetworkDAO().get(getVnicProfile().getNetworkId());
+        }
+
+        return network;
+    }
 }
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 ecb980a..c838ba1 100644
--- 
a/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
+++ 
b/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
@@ -469,6 +469,12 @@
 VLAN_ID_MISMATCH_FOR_MANAGEMENT_NETWORK_CONFIGURATION=Failed to configure 
management network on host ${VdsName}. Host ${VdsName} has an interface 
${InterfaceName} for the management network configuration with VLAN-ID 
(${VlanId}), which is different from data-center definition (${MgmtVlanId}).
 SETUP_NETWORK_FAILED_FOR_MANAGEMENT_NETWORK_CONFIGURATION=Failed to configure 
management network on host ${VdsName} due to setup networks failure.
 PERSIST_NETWORK_FAILED_FOR_MANAGEMENT_NETWORK=Failed to activate host 
${VdsName} due to failure in persisting the management network configuration.
+ADD_VNIC_PROFILE=VM network interface profile ${VnicProfileName} was added to 
network: ${NetworkName} in Data Center: ${DataCenterName}.
+ADD_VNIC_PROFILE_FAILED=Failed to add VM network interface profile 
${VnicProfileName} to network: ${NetworkName} in Data Center: ${DataCenterName}
+UPDATE_VNIC_PROFILE=VM network interface profile ${VnicProfileName} was 
updated for network: ${NetworkName} in Data Center: ${DataCenterName}.
+UPDATE_VNIC_PROFILE_FAILED=Failed to update VM network interface profile 
${VnicProfileName} for network: ${NetworkName} in Data Center: 
${DataCenterName}.
+REMOVE_VNIC_PROFILE=VM network interface profile ${VnicProfileName} was 
removed from network: ${NetworkName} in Data Center: ${DataCenterName}.
+REMOVE_VNIC_PROFILE_FAILED=Failed to remove VM network interface profile 
${VnicProfileName} from network: ${NetworkName} in Data Center: 
${DataCenterName}.
 SYSTEM_DEACTIVATED_STORAGE_DOMAIN=Storage Domain ${StorageDomainName} (Data 
Center ${StoragePoolName}) was deactivated by system because it's not visible 
by any of the hosts.
 SYSTEM_DEACTIVATE_STORAGE_DOMAIN_FAILED=Failed to deactivate Storage Domain 
${StorageDomainName} (Data Center ${StoragePoolName}).
 VDS_SET_NONOPERATIONAL_DOMAIN=Host ${VdsName} cannot access one of the Storage 
Domains attached to the Data Center ${StoragePoolName}. Setting Host state to 
Non-Operational.


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3d41b5487faf7eafaeae0ed929fd53ad26e7416a
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Moti Asayag <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to