Maor Lipchuk has uploaded a new change for review. Change subject: core: Use audit log only when failed to use retrieve command. ......................................................................
core: Use audit log only when failed to use retrieve command. Using a warning audit log only when the retrieve of OVF_STORE disks has been failed. When there are no OVF_STORE disks available we should only print a warnning log which indicates that there were no OVF_STORE in the storage domain. Change-Id: I1eb5a687429c081f42bdc63bf3b8dd17eb295236 Signed-off-by: Maor Lipchuk <mlipc...@redhat.com> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/AttachStorageDomainToPoolCommand.java 1 file changed, 7 insertions(+), 6 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/61/30061/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/AttachStorageDomainToPoolCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/AttachStorageDomainToPoolCommand.java index 341b798..de342ca 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/AttachStorageDomainToPoolCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/AttachStorageDomainToPoolCommand.java @@ -191,7 +191,6 @@ protected List<OvfEntityData> getEntitiesFromStorageOvfDisk() { List<OvfEntityData> ovfEntitiesFromTar = Collections.emptyList(); - boolean isOvfDataRetrieved = false; // Get all unregistered disks. List<Disk> unregisteredDisks = getBackend().runInternalQuery(VdcQueryType.GetUnregisteredDisks, new GetUnregisteredDisksQueryParameters(getParameters().getStorageDomainId(), @@ -214,19 +213,21 @@ ovfEntitiesFromTar = OvfUtils.getOvfEntities((byte[]) retrievedByteData.getReturnValue(), getParameters().getStorageDomainId()); - isOvfDataRetrieved = true; } } catch (RuntimeException e) { // We are catching RuntimeException, since the call for OvfUtils.getOvfEntities will throw // a RuntimeException if there is a problem to untar the file. log.errorFormat("Image data could not be retrieved for disk id {0} in storage domain id {1}. Error: {2}", ovfDisk.getId(), - getParameters().getStorageDomainId(), e); + getParameters().getStorageDomainId(), + e); + AuditLogDirector.log(this, AuditLogType.RETRIEVE_OVF_STORE_FAILED); + } } - } - if (!isOvfDataRetrieved) { - AuditLogDirector.log(this, AuditLogType.RETRIEVE_OVF_STORE_FAILED); + } else { + log.warnFormat("There are no OVF_STORE disks on storage domain id {0}", + getParameters().getStorageDomainId()); } return ovfEntitiesFromTar; } -- To view, visit http://gerrit.ovirt.org/30061 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1eb5a687429c081f42bdc63bf3b8dd17eb295236 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Maor Lipchuk <mlipc...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches