Github user jburwell commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1615#discussion_r74079012
  
    --- Diff: server/src/com/cloud/storage/ImageStoreDetailsUtil.java ---
    @@ -20,48 +20,68 @@
     
     import javax.inject.Inject;
     
    +import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
    +import org.apache.cloudstack.framework.config.impl.ConfigurationVO;
     import org.apache.cloudstack.storage.datastore.db.ImageStoreDao;
     import org.apache.cloudstack.storage.datastore.db.ImageStoreDetailsDao;
     import org.apache.cloudstack.storage.datastore.db.ImageStoreVO;
     
    +import com.cloud.capacity.CapacityManager;
    +
     public class ImageStoreDetailsUtil {
     
         @Inject
         protected ImageStoreDao imageStoreDao;
         @Inject
         protected ImageStoreDetailsDao imageStoreDetailsDao;
    +    @Inject
    +    protected ConfigurationDao configurationDao;
     
         /**
    -     * Obtain NFS protocol version (if provided) for a store id.<br/>
    -     * It can be set by adding an entry in {@code image_store_details} 
table, providing {@code name=nfs.version} and {@code value=X} (e.g. 3)
    +     * Retrieve global secondary storage NFS version default value
    +     * @return global default value
    +     */
    +    protected Integer getGlobalDefaultNfsVersion(){
    +        ConfigurationVO globalNfsVersion = 
configurationDao.findByName(CapacityManager.ImageStoreNFSVersion.key());
    +        String value = globalNfsVersion.getValue();
    --- End diff --
    
    @nvazquez that seems like a good solution.  Also, please use 
``Preconditions.checkState(globalNfsVersion !=null, "Unable to find global NFS 
version for version key" + CapacityManager.ImageStoreNFSVersion.key())`` to 
help someone understand why it happened in the unlikely event it occurs.


---
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