brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sjcorb...@apache.org
Subject [06/15] incubator-brooklyn git commit: Derive correct URL path for specified version.
Date Fri, 11 Dec 2015 12:39:56 GMT
Derive correct URL path for specified version.


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/3e639874
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/3e639874
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/3e639874

Branch: refs/heads/master
Commit: 3e6398740489bd67cc3901d9892eff799a2690d6
Parents: c2088db
Author: Alasdair Hodge <github@alasdairhodge.co.uk>
Authored: Wed Dec 9 12:57:11 2015 +0000
Committer: Alasdair Hodge <github@alasdairhodge.co.uk>
Committed: Wed Dec 9 12:57:54 2015 +0000

----------------------------------------------------------------------
 .../org/apache/brooklyn/entity/database/mysql/MySqlNode.java    | 2 +-
 .../apache/brooklyn/entity/database/mysql/MySqlSshDriver.java   | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/3e639874/software/database/src/main/java/org/apache/brooklyn/entity/database/mysql/MySqlNode.java
----------------------------------------------------------------------
diff --git a/software/database/src/main/java/org/apache/brooklyn/entity/database/mysql/MySqlNode.java
b/software/database/src/main/java/org/apache/brooklyn/entity/database/mysql/MySqlNode.java
index 7f9e508..6306956 100644
--- a/software/database/src/main/java/org/apache/brooklyn/entity/database/mysql/MySqlNode.java
+++ b/software/database/src/main/java/org/apache/brooklyn/entity/database/mysql/MySqlNode.java
@@ -50,7 +50,7 @@ public interface MySqlNode extends SoftwareProcess, HasShortName, DatastoreCommo
     //http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.26-linux-glibc2.5-x86_64.tar.gz
     @SetFromFlag("downloadUrl")
     BasicAttributeSensorAndConfigKey<String> DOWNLOAD_URL = new StringAttributeSensorAndConfigKey(
-            Attributes.DOWNLOAD_URL, "http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-${version}-${driver.osTag}.tar.gz");
+            Attributes.DOWNLOAD_URL, "http://dev.mysql.com/get/Downloads/MySQL-${driver.majorVersion}/mysql-${version}-${driver.osTag}.tar.gz");
 
     @SetFromFlag("port")
     PortAttributeSensorAndConfigKey MYSQL_PORT = new PortAttributeSensorAndConfigKey("mysql.port",
"MySQL port", PortRanges.fromString("3306, 13306+"));

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/3e639874/software/database/src/main/java/org/apache/brooklyn/entity/database/mysql/MySqlSshDriver.java
----------------------------------------------------------------------
diff --git a/software/database/src/main/java/org/apache/brooklyn/entity/database/mysql/MySqlSshDriver.java
b/software/database/src/main/java/org/apache/brooklyn/entity/database/mysql/MySqlSshDriver.java
index 7b38cbd..868d158 100644
--- a/software/database/src/main/java/org/apache/brooklyn/entity/database/mysql/MySqlSshDriver.java
+++ b/software/database/src/main/java/org/apache/brooklyn/entity/database/mysql/MySqlSshDriver.java
@@ -111,6 +111,11 @@ public class MySqlSshDriver extends AbstractSoftwareProcessSshDriver
implements
         return "mymysql.cnf";
     }
 
+    // Only invoked to determine the default download URL form the specified version.
+    public String getMajorVersion() {
+        return getEntity().config().get(MySqlNode.SUGGESTED_VERSION).replaceAll("(\\d+\\.\\d+)\\.\\d+",
"$1");
+    }
+
     public String getDefaultUnpackedDirectoryName() {
         return Strings.removeAllFromEnd(resolver.getFilename(), ".tar.gz");
     }


Mime
View raw message