DaanHoogland commented on code in PR #6699:
URL: https://github.com/apache/cloudstack/pull/6699#discussion_r1267770455


##########
plugins/storage/volume/default/src/main/java/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java:
##########
@@ -550,7 +509,16 @@ private HypervisorType getHypervisorType(long hostId) {
 
     @Override
     public boolean attachHost(DataStore store, HostScope scope, 
StoragePoolInfo existingInfo) {
-        dataStoreHelper.attachHost(store, scope, existingInfo);
+        DataStore dataStore = dataStoreHelper.attachHost(store, scope, 
existingInfo);
+        if(existingInfo.getCapacityBytes() == 0){
+            try {
+                storageMgr.connectHostToSharedPool(scope.getScopeId(), 
dataStore.getId());
+            } catch (StorageUnavailableException ex) {
+                
java.util.logging.Logger.getLogger(CloudStackPrimaryDataStoreLifeCycleImpl.class.getName()).log(Level.SEVERE,
 null, ex);
+            } catch (StorageConflictException ex) {
+                
java.util.logging.Logger.getLogger(CloudStackPrimaryDataStoreLifeCycleImpl.class.getName()).log(Level.SEVERE,
 null, ex);

Review Comment:
   what samples are those @DK101010 ?
   in the way @JoaoJandre describes a locally stored reference to the right 
logger is used and no lookup in the logging component has to be done. This is 
general practice and I am curious in what context it was done in the way you 
did it, and whether that was ligit.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to