diff --git a/manifests/init.pp b/manifests/init.pp index 09701b2..ac02883 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -29,12 +29,13 @@ ensure => present, } - $jar_name = "selenium-server-standalone-${version}.jar" + $jar_name = "selenium-server-standalone-${version}.jar" + $path_version = regsubst($version, '^(\d+\.\d+)\.\d+$', '\1') if $url { $jar_url = $url } else { - $jar_url = "https://selenium.googlecode.com/files/${jar_name}" + $jar_url = "https://selenium-release.storage.googleapis.com/${path_version}/${jar_name}" } File { diff --git a/spec/classes/selenium_spec.rb b/spec/classes/selenium_spec.rb index 468264c..80930b8 100644 --- a/spec/classes/selenium_spec.rb +++ b/spec/classes/selenium_spec.rb @@ -18,6 +18,12 @@ p.merge!(params) end + # The new download URL has the major.minor version as a path component but + # excludes the .patch. Eg. + # https://selenium-release.storage.googleapis.com/./selenium-server-standalone-...jar + + path_version = p[:version].match(/^(\d+\.\d+)\./)[1] + it do should contain_user(p[:user]).with_gid(p[:group]) should contain_group(p[:group]) @@ -46,7 +52,7 @@ 'target' => "#{p[:install_root]}/log", }) should contain_wget__fetch('selenium-server-standalone').with({ - 'source' => "https://selenium.googlecode.com/files/selenium-server-standalone-#{p[:version]}.jar", + 'source' => "https://selenium-release.storage.googleapis.com/#{path_version}/selenium-server-standalone-#{p[:version]}.jar", 'destination' => "#{p[:install_root]}/jars/selenium-server-standalone-#{p[:version]}.jar", 'timeout' => p[:download_timeout], 'execuser' => p[:user],