Allon Mureinik has posted comments on this change.

Change subject: core: Block import of storage domain if the storage contains 
hosted engine
......................................................................


Patch Set 2: Code-Review-1

(2 comments)

1. See comments inline
2. General: in the messages, refer to Self Hosted Engine, not "hosted engine".
3. Missing SQL script change to add the (default) conf value.

http://gerrit.ovirt.org/#/c/36549/2/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/AddExistingBlockStorageDomainCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/AddExistingBlockStorageDomainCommand.java:

Line 56:     protected boolean canAddDomain() {
Line 57:         StorageDomainValidator validator = new 
StorageDomainValidator(getStorageDomain());
Line 58:         if (!validate(validator.isHostedEngineStorage())) {
Line 59:             return false;
Line 60:         }
This should be done AFTER the existence check in the next block
Line 61: 
Line 62:         if 
(getStorageDomainStaticDAO().get(getStorageDomain().getId()) != null) {
Line 63:             return 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_ALREADY_EXIST);
Line 64:         }


http://gerrit.ovirt.org/#/c/36549/2/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/AddExistingBlockStorageDomainCommandTest.java
File 
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/AddExistingBlockStorageDomainCommandTest.java:

Line 82:     @Test
Line 83:     public void testAddHostedEngineStorageFails() {
Line 84:         
parameters.getStorageDomain().setStorageName(StorageConstants.HOSTED_ENGINE_STORAGE_DOMAIN_NAME);
Line 85:         assertFalse(command.canAddDomain());
Line 86:         CanDoActionTestUtils.assertCanDoActionMessages("", command, 
VdcBllMessages.ACTION_TYPE_FAILED_HOSTED_ENGINE_STORAGE);
Replace these two lines with runAndAssertCanDoActionFailure.
Line 87:     }
Line 88: 
Line 89:     private static StorageDomainStatic getStorageDomain() {
Line 90:         StorageDomainStatic storageDomain = new StorageDomainStatic();


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I36db8c4a7a1d13be8874407c56596ecd9ab74333
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Tal Nisan <tni...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@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