Github user mike-tutkowski commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/547#discussion_r36490618
  
    --- Diff: 
engine/storage/volume/src/org/apache/cloudstack/storage/datastore/provider/DefaultHostListener.java
 ---
    @@ -71,6 +74,17 @@ public boolean hostConnect(long hostId, long poolId) {
             assert (answer instanceof ModifyStoragePoolAnswer) : "Well, now 
why won't you actually return the ModifyStoragePoolAnswer when it's 
ModifyStoragePoolCommand? Pool=" +
                 pool.getId() + "Host=" + hostId;
             ModifyStoragePoolAnswer mspAnswer = 
(ModifyStoragePoolAnswer)answer;
    +        if (mspAnswer.getLocalDatastoreName() != null && pool.isShared()) {
    +            String datastoreName = mspAnswer.getLocalDatastoreName();
    +            List<StoragePoolVO> localStoragePools = 
this.primaryStoreDao.listLocalStoragePoolByPath(pool.getDataCenterId(), 
datastoreName);
    +            for (StoragePoolVO localStoragePool : localStoragePools) {
    +                if (datastoreName.equals(localStoragePool.getPath())) {
    +                    s_logger.warn("Storage pool: " + pool.getId() + " has 
already been added as local storage: " + localStoragePool.getName());
    +                    throw new StorageConflictException("Cannot add shared 
storage pool: " + pool.getId() + " because it has already been added as local 
storage:"
    --- End diff --
    
    Might want to put a space after the colon for readability.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to