Fix rubyVersion parsing
- revert part of commit implemented in change #36213
https://gerrit.mcp.mirantis.com/#/c/36213/
- original change added feature allowing to set
ruby version in .kitchen.yml
- unfortunately this way it is not possible, so
we are reverting it back
- this mentioned feature will be probably
reimplemented later in different commit
using different approach
Related: PROD-26476 (PROD:26476)
Change-Id: Ic1e7a708e820832634f10bf1bd71ae6a70f9770f
diff --git a/test-salt-formulas-env.groovy b/test-salt-formulas-env.groovy
index 9364ae5..e007fe9 100644
--- a/test-salt-formulas-env.groovy
+++ b/test-salt-formulas-env.groovy
@@ -120,6 +120,7 @@
common.infoMsg("Openstack Kitchen test configuration found, running Openstack kitchen tests.")
kitchenFileName = ".kitchen.openstack.yml"
envOverrides.add("KITCHEN_YAML=${kitchenFileName}")
+ rubyVersion = '2.5.0'
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: openstack_credentials_id,
usernameVariable: 'OS_USERNAME', passwordVariable: 'OS_PASSWORD'], ]) {
env.OS_USERNAME = OS_USERNAME
@@ -132,12 +133,9 @@
} else if (fileExists(".kitchen.yml")) {
common.infoMsg("Docker Kitchen test configuration found, running Docker kitchen tests.")
kitchenFileName = ".kitchen.yml"
+ rubyVersion = '2.4.1'
}
if (kitchenFileName) {
- def kitchenYML = readYaml(file: "${kitchenFileName}")
- if (kitchenYML.containsKey("driver")) {
- rubyVersion = kitchenYML.get("mcp_ruby_version", '2.4.1')
- }
ruby.ensureRubyEnv(rubyVersion)
if (!fileExists("Gemfile")) {
sh("curl -s -o ./Gemfile 'https://gerrit.mcp.mirantis.com/gitweb?p=salt-formulas/salt-formulas-scripts.git;a=blob_plain;f=Gemfile;hb=refs/heads/master'")