You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ro...@apache.org on 2018/05/21 06:56:38 UTC

[cloudstack] branch 4.11 updated: registerIso: Fixes #2654 register iso in all zones (#2652)

This is an automated email from the ASF dual-hosted git repository.

rohit pushed a commit to branch 4.11
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/4.11 by this push:
     new 9aa1743  registerIso: Fixes #2654 register iso in all zones (#2652)
9aa1743 is described below

commit 9aa1743984de30eb96e8a3fad9690f4d73bc255e
Author: Nicolas Vazquez <ni...@gmail.com>
AuthorDate: Mon May 21 03:56:31 2018 -0300

    registerIso: Fixes #2654 register iso in all zones (#2652)
    
    Fix to register of iso in all zones. Fixes #2654.
---
 server/src/com/cloud/template/TemplateAdapterBase.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/server/src/com/cloud/template/TemplateAdapterBase.java b/server/src/com/cloud/template/TemplateAdapterBase.java
index 7467e30..e7f21b1 100644
--- a/server/src/com/cloud/template/TemplateAdapterBase.java
+++ b/server/src/com/cloud/template/TemplateAdapterBase.java
@@ -24,6 +24,7 @@ import java.util.Map;
 import javax.inject.Inject;
 
 import org.apache.cloudstack.api.command.user.template.GetUploadParamsForTemplateCmd;
+import org.apache.commons.collections.CollectionUtils;
 import org.apache.log4j.Logger;
 
 import org.apache.cloudstack.api.ApiConstants;
@@ -325,7 +326,7 @@ public abstract class TemplateAdapterBase extends AdapterBase implements Templat
         Long zoneId = cmd.getZoneId();
         // ignore passed zoneId if we are using region wide image store
         List<ImageStoreVO> stores = _imgStoreDao.findRegionImageStores();
-        if (!(stores != null && stores.size() > 0)) {
+        if (CollectionUtils.isEmpty(stores) && zoneId != null && zoneId > 0L) {
             zoneList = new ArrayList<>();
             zoneList.add(zoneId);
         }

-- 
To stop receiving notification emails like this one, please contact
rohit@apache.org.