Maor Lipchuk has posted comments on this change.

Change subject: core: Adding import of unregistered VM template
......................................................................


Patch Set 17:

(6 comments)

http://gerrit.ovirt.org/#/c/27581/17/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmTemplateFromConfigurationCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmTemplateFromConfigurationCommand.java:

Line 29:     @Override
Line 30:     public Guid getVmTemplateId() {
Line 31:         if (isImagesAlreadyOnTarget()) {
Line 32:             return getParameters().getContainerId();
Line 33:         } else {
> can remove the 'else' clause...
done
Line 34:             return super.getVmTemplateId();
Line 35:         }
Line 36:     }
Line 37: 


Line 39:     protected boolean canDoAction() {
Line 40:         init();
Line 41:         if (isImagesAlreadyOnTarget()) {
Line 42:             if (ovfEntityData == null && 
!getParameters().isImportAsNewEntity()) {
Line 43:                 // 
addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_UNSUPPORTED_OVF);
> shouldn't add the message? or at least log?
added CDA message
Line 44:                 return false;
Line 45:             }
Line 46: 
Line 47:             setStorageDomainId(ovfEntityData.getStorageDomainId());


Line 59:         return super.canDoAction();
Line 60:     }
Line 61: 
Line 62:     private void init() {
Line 63:         VmTemplate vmFromConfiguration;
> seems it can be declared inside the 'try' branch
moved other from the try
Line 64:         ovfEntityData =
Line 65:                 
getUnregisteredOVFDataDao().getByEntityIdAndStorageDomain(getParameters().getContainerId(),
Line 66:                         getParameters().getStorageDomainId());
Line 67:         if (ovfEntityData != null) {


Line 80:         setVdsGroupId(getParameters().getVdsGroupId());
Line 81:         setStoragePoolId(getVdsGroup().getStoragePoolId());
Line 82:     }
Line 83: 
Line 84:     private void initUnregisteredVM() {
> unused method? any way, it's quite similar to 'init()' - should probably co
removed (merge issues)
Line 85:         VmTemplate vmFromConfiguration;
Line 86:         ovfEntityData =
Line 87:                 
getUnregisteredOVFDataDao().getByEntityIdAndStorageDomain(getParameters().getContainerId(),
Line 88:                         getParameters().getStorageDomainId());


Line 81:         setStoragePoolId(getVdsGroup().getStoragePoolId());
Line 82:     }
Line 83: 
Line 84:     private void initUnregisteredVM() {
Line 85:         VmTemplate vmFromConfiguration;
> same
removed
Line 86:         ovfEntityData =
Line 87:                 
getUnregisteredOVFDataDao().getByEntityIdAndStorageDomain(getParameters().getContainerId(),
Line 88:                         getParameters().getStorageDomainId());
Line 89:         if (ovfEntityData != null) {


Line 95:                 
getParameters().setDestDomainId(ovfEntityData.getStorageDomainId());
Line 96:                 
getParameters().setSourceDomainId(ovfEntityData.getStorageDomainId());
Line 97:             } catch (OvfReaderException e) {
Line 98:                 log.errorFormat("failed to parse a given ovf 
configuration: \n" + ovfEntityData.getOvfData(), e);
Line 99:                 // 
addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_UNSUPPORTED_OVF);
> can be removed now?
removed
Line 100:             }
Line 101:         }
Line 102:     }
Line 103: 


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I4fc184e687cbeebf4aa732c901f98222d5b11097
Gerrit-PatchSet: 17
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Maor Lipchuk <mlipc...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Arik Hadas <aha...@redhat.com>
Gerrit-Reviewer: Daniel Erez <de...@redhat.com>
Gerrit-Reviewer: Liron Ar <lara...@redhat.com>
Gerrit-Reviewer: Maor Lipchuk <mlipc...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to