cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mc...@apache.org
Subject [2/3] git commit: updated refs/heads/master to e356465
Date Tue, 12 Aug 2014 18:51:53 GMT
Revert "CLOUDSTACK-7312:ISOs cannot be downloaded from URLs without matching"

This reverts commit 737f76df8c86666b47ba347ae46fc10d73b1fee6.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/83bd4d60
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/83bd4d60
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/83bd4d60

Branch: refs/heads/master
Commit: 83bd4d60f118050840cf53e96369999c6e0582ad
Parents: a8316de
Author: Min Chen <min.chen@citrix.com>
Authored: Mon Aug 11 17:04:06 2014 -0700
Committer: Min Chen <min.chen@citrix.com>
Committed: Tue Aug 12 11:43:08 2014 -0700

----------------------------------------------------------------------
 server/src/com/cloud/template/HypervisorTemplateAdapter.java | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/83bd4d60/server/src/com/cloud/template/HypervisorTemplateAdapter.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/template/HypervisorTemplateAdapter.java b/server/src/com/cloud/template/HypervisorTemplateAdapter.java
index 419a501..51dedf7 100755
--- a/server/src/com/cloud/template/HypervisorTemplateAdapter.java
+++ b/server/src/com/cloud/template/HypervisorTemplateAdapter.java
@@ -113,6 +113,12 @@ public class HypervisorTemplateAdapter extends TemplateAdapterBase {
     public TemplateProfile prepare(RegisterIsoCmd cmd) throws ResourceAllocationException
{
         TemplateProfile profile = super.prepare(cmd);
         String url = profile.getUrl();
+
+        if ((!url.toLowerCase().endsWith("iso")) && (!url.toLowerCase().endsWith("iso.zip"))
&& (!url.toLowerCase().endsWith("iso.bz2")) &&
+            (!url.toLowerCase().endsWith("iso.gz"))) {
+            throw new InvalidParameterValueException("Please specify a valid iso");
+        }
+
         UriUtils.validateUrl(url);
         profile.setUrl(url);
         // Check that the resource limit for secondary storage won't be exceeded


Mime
View raw message