Moti Asayag has uploaded a new change for review.

Change subject: engine: Improve import vm message when profile not found
......................................................................

engine: Improve import vm message when profile not found

If a vnic profile cannot be found while importing a vm to
the system, the message should include that warning.

In addition, the network name should be printed only once.

Change-Id: I2099756b3ff9c07a6c121a3601b8c7d1d5811e38
Bug-Url: https://bugzilla.redhat.com/1004386
Signed-off-by: Moti Asayag <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/vm/VnicProfileHelper.java
M 
backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
2 files changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/87/20987/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/vm/VnicProfileHelper.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/vm/VnicProfileHelper.java
index 984fb5f..44308b4 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/vm/VnicProfileHelper.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/vm/VnicProfileHelper.java
@@ -1,8 +1,10 @@
 package org.ovirt.engine.core.bll.network.vm;
 
 import java.util.ArrayList;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 import org.apache.commons.lang.ObjectUtils;
 import org.apache.commons.lang.StringUtils;
@@ -31,7 +33,7 @@
 import org.ovirt.engine.core.dao.network.VnicProfileViewDao;
 
 public class VnicProfileHelper {
-    private List<String> invalidNetworkNames = new ArrayList<>();
+    private Set<String> invalidNetworkNames = new HashSet<>();
     private List<String> invalidIfaceNames = new ArrayList<>();
     private Map<String, Network> networksInClusterByName;
     private List<VnicProfileView> vnicProfilesInDc;
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 9d11a5b..92653ce 100644
--- 
a/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
+++ 
b/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
@@ -585,7 +585,7 @@
 USER_ADD_EXTERNAL_JOB=New external Job ${description} was added by user 
${UserName}
 USER_ADD_EXTERNAL_JOB_FAILED=Failed to add new external Job ${description}
 STORAGE_DOMAIN_TASKS_ERROR=Storage Domain ${StorageDomainName} is down while 
there are tasks running on it. These tasks may fail.
-IMPORTEXPORT_IMPORT_VM_INVALID_INTERFACES=While importing VM ${EntityName}, 
the Network/s ${Networks} were found to be Non-VM Networks or do not exist in 
Cluster. Network Name was not set in the Interface/s ${Interfaces}.
+IMPORTEXPORT_IMPORT_VM_INVALID_INTERFACES=While importing VM ${EntityName}, 
the Network/s ${Networks} were found to be Non-VM Networks or do not exist in 
Cluster or missing a suitable VM network interface profile. Network Name was 
not set in the Interface/s ${Interfaces}.
 IMPORTEXPORT_IMPORT_TEMPLATE_INVALID_INTERFACES=While importing Template 
${EntityName}, the Network/s ${Networks} were found to be Non-VM Networks or do 
not exist in Cluster. Network Name was not set in the Interface/s ${Interfaces}.
 IMPORTEXPORT_SNAPSHOT_VM_INVALID_INTERFACES=While previewing a snapshot of VM 
${EntityName}, the Network/s ${Networks} were found to be Non-VM Networks or do 
not exist in Cluster. Network Name was not set in the Interface/s ${Interfaces}.
 ADD_VM_FROM_SNAPSHOT_INVALID_INTERFACES=While adding vm ${EntityName} from 
snapshot, the Network/s ${Networks} were found to be Non-VM Networks or do not 
exist in Cluster. Network Name was not set in the Interface/s ${Interfaces}.


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2099756b3ff9c07a6c121a3601b8c7d1d5811e38
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