Sergey Kolekonov | ba20398 | 2016-12-21 18:32:17 +0400 | [diff] [blame] | 1 | package com.mirantis.mk |
| 2 | |
| 3 | /** |
| 4 | * |
| 5 | * Openstack functions |
| 6 | * |
| 7 | */ |
| 8 | |
| 9 | /** |
Tomáš Kukrál | c3964e5 | 2017-02-22 14:07:37 +0100 | [diff] [blame] | 10 | * Convert maps |
| 11 | * |
| 12 | */ |
| 13 | |
| 14 | @NonCPS def entries(m) { |
| 15 | return m.collect {k, v -> [k, v]} |
| 16 | } |
| 17 | |
| 18 | /** |
Sergey Kolekonov | ba20398 | 2016-12-21 18:32:17 +0400 | [diff] [blame] | 19 | * Install OpenStack service clients in isolated environment |
| 20 | * |
| 21 | * @param path Path where virtualenv is created |
| 22 | * @param version Version of the OpenStack clients |
| 23 | */ |
| 24 | |
Tomáš Kukrál | c6a94c6 | 2017-06-19 14:44:24 +0200 | [diff] [blame] | 25 | def setupOpenstackVirtualenv(path, version = 'kilo') { |
iberezovskiy | d4240b5 | 2017-02-20 17:18:28 +0400 | [diff] [blame] | 26 | def python = new com.mirantis.mk.Python() |
Sergey Kolekonov | ba20398 | 2016-12-21 18:32:17 +0400 | [diff] [blame] | 27 | |
| 28 | def openstack_kilo_packages = [ |
| 29 | 'python-cinderclient>=1.3.1,<1.4.0', |
| 30 | 'python-glanceclient>=0.19.0,<0.20.0', |
| 31 | 'python-heatclient>=0.6.0,<0.7.0', |
| 32 | 'python-keystoneclient>=1.6.0,<1.7.0', |
| 33 | 'python-neutronclient>=2.2.6,<2.3.0', |
| 34 | 'python-novaclient>=2.19.0,<2.20.0', |
| 35 | 'python-swiftclient>=2.5.0,<2.6.0', |
Jakub Josef | bd92732 | 2017-05-30 13:20:27 +0000 | [diff] [blame] | 36 | 'python-openstackclient>=1.7.0,<1.8.0', |
Sergey Kolekonov | ba20398 | 2016-12-21 18:32:17 +0400 | [diff] [blame] | 37 | 'oslo.config>=2.2.0,<2.3.0', |
| 38 | 'oslo.i18n>=2.3.0,<2.4.0', |
| 39 | 'oslo.serialization>=1.8.0,<1.9.0', |
| 40 | 'oslo.utils>=1.4.0,<1.5.0', |
Ales Komarek | d874d48 | 2016-12-26 10:33:29 +0100 | [diff] [blame] | 41 | 'docutils>=0.12' |
Sergey Kolekonov | ba20398 | 2016-12-21 18:32:17 +0400 | [diff] [blame] | 42 | ] |
| 43 | |
Tomáš Kukrál | 381a8c9 | 2017-06-21 09:01:52 +0200 | [diff] [blame] | 44 | def openstack_latest_packages = [ |
| 45 | 'python-openstackclient', |
| 46 | 'python-heatclient', |
Tomáš Kukrál | c6a94c6 | 2017-06-19 14:44:24 +0200 | [diff] [blame] | 47 | ] |
Sergey Kolekonov | ba20398 | 2016-12-21 18:32:17 +0400 | [diff] [blame] | 48 | |
Tomáš Kukrál | c6a94c6 | 2017-06-19 14:44:24 +0200 | [diff] [blame] | 49 | if (version == 'kilo') { |
Sergey Kolekonov | ba20398 | 2016-12-21 18:32:17 +0400 | [diff] [blame] | 50 | requirements = openstack_kilo_packages |
Tomáš Kukrál | c6a94c6 | 2017-06-19 14:44:24 +0200 | [diff] [blame] | 51 | } else if (version == 'liberty') { |
Sergey Kolekonov | ba20398 | 2016-12-21 18:32:17 +0400 | [diff] [blame] | 52 | requirements = openstack_kilo_packages |
Tomáš Kukrál | c6a94c6 | 2017-06-19 14:44:24 +0200 | [diff] [blame] | 53 | } else if (version == 'mitaka') { |
Sergey Kolekonov | ba20398 | 2016-12-21 18:32:17 +0400 | [diff] [blame] | 54 | requirements = openstack_kilo_packages |
Tomáš Kukrál | 381a8c9 | 2017-06-21 09:01:52 +0200 | [diff] [blame] | 55 | } else { |
Sergey Kolekonov | ba20398 | 2016-12-21 18:32:17 +0400 | [diff] [blame] | 56 | requirements = openstack_latest_packages |
| 57 | } |
| 58 | python.setupVirtualenv(path, 'python2', requirements) |
| 59 | } |
| 60 | |
| 61 | /** |
| 62 | * create connection to OpenStack API endpoint |
| 63 | * |
| 64 | * @param url OpenStack API endpoint address |
| 65 | * @param credentialsId Credentials to the OpenStack API |
| 66 | * @param project OpenStack project to connect to |
| 67 | */ |
kairat_kushaev | 0a26bf7 | 2017-05-18 13:20:09 +0400 | [diff] [blame] | 68 | def createOpenstackEnv(url, credentialsId, project, project_domain="default", |
Tomáš Kukrál | 381a8c9 | 2017-06-21 09:01:52 +0200 | [diff] [blame] | 69 | project_id="", user_domain="default", api_ver="2", cacert="/etc/ssl/certs/ca-certificates.crt") { |
iberezovskiy | d4240b5 | 2017-02-20 17:18:28 +0400 | [diff] [blame] | 70 | def common = new com.mirantis.mk.Common() |
Ales Komarek | 0e558ee | 2016-12-23 13:02:55 +0100 | [diff] [blame] | 71 | rcFile = "${env.WORKSPACE}/keystonerc" |
Sergey Kolekonov | ba20398 | 2016-12-21 18:32:17 +0400 | [diff] [blame] | 72 | creds = common.getPasswordCredentials(credentialsId) |
Alexander Tivelkov | f89a188 | 2017-01-11 13:29:35 +0300 | [diff] [blame] | 73 | rc = """set +x |
| 74 | export OS_USERNAME=${creds.username} |
Ales Komarek | 0e558ee | 2016-12-23 13:02:55 +0100 | [diff] [blame] | 75 | export OS_PASSWORD=${creds.password.toString()} |
| 76 | export OS_TENANT_NAME=${project} |
| 77 | export OS_AUTH_URL=${url} |
| 78 | export OS_AUTH_STRATEGY=keystone |
kairat_kushaev | 0a26bf7 | 2017-05-18 13:20:09 +0400 | [diff] [blame] | 79 | export OS_PROJECT_NAME=${project} |
Jakub Josef | bd92732 | 2017-05-30 13:20:27 +0000 | [diff] [blame] | 80 | export OS_PROJECT_ID=${project_id} |
kairat_kushaev | 0a26bf7 | 2017-05-18 13:20:09 +0400 | [diff] [blame] | 81 | export OS_PROJECT_DOMAIN_ID=${project_domain} |
Jakub Josef | bd92732 | 2017-05-30 13:20:27 +0000 | [diff] [blame] | 82 | export OS_USER_DOMAIN_NAME=${user_domain} |
| 83 | export OS_API_IDENTITY_VERSION=${api_ver} |
Tomáš Kukrál | 381a8c9 | 2017-06-21 09:01:52 +0200 | [diff] [blame] | 84 | export OS_CACERT=${cacert} |
Alexander Tivelkov | f89a188 | 2017-01-11 13:29:35 +0300 | [diff] [blame] | 85 | set -x |
Ales Komarek | 0e558ee | 2016-12-23 13:02:55 +0100 | [diff] [blame] | 86 | """ |
| 87 | writeFile file: rcFile, text: rc |
| 88 | return rcFile |
Sergey Kolekonov | ba20398 | 2016-12-21 18:32:17 +0400 | [diff] [blame] | 89 | } |
| 90 | |
| 91 | /** |
| 92 | * Run command with OpenStack env params and optional python env |
| 93 | * |
| 94 | * @param cmd Command to be executed |
| 95 | * @param env Environmental parameters with endpoint credentials |
| 96 | * @param path Optional path to virtualenv with specific clients |
| 97 | */ |
| 98 | def runOpenstackCommand(cmd, venv, path = null) { |
iberezovskiy | d4240b5 | 2017-02-20 17:18:28 +0400 | [diff] [blame] | 99 | def python = new com.mirantis.mk.Python() |
Sergey Kolekonov | ba20398 | 2016-12-21 18:32:17 +0400 | [diff] [blame] | 100 | openstackCmd = ". ${venv}; ${cmd}" |
| 101 | if (path) { |
| 102 | output = python.runVirtualenvCommand(path, openstackCmd) |
| 103 | } |
| 104 | else { |
| 105 | echo("[Command]: ${openstackCmd}") |
| 106 | output = sh ( |
| 107 | script: openstackCmd, |
| 108 | returnStdout: true |
| 109 | ).trim() |
| 110 | } |
| 111 | return output |
| 112 | } |
| 113 | |
| 114 | /** |
| 115 | * Get OpenStack Keystone token for current credentials |
| 116 | * |
| 117 | * @param env Connection parameters for OpenStack API endpoint |
| 118 | * @param path Optional path to the custom virtualenv |
| 119 | */ |
| 120 | def getKeystoneToken(client, path = null) { |
iberezovskiy | d4240b5 | 2017-02-20 17:18:28 +0400 | [diff] [blame] | 121 | def python = new com.mirantis.mk.Python() |
Jakub Josef | bd92732 | 2017-05-30 13:20:27 +0000 | [diff] [blame] | 122 | cmd = "openstack token issue" |
Sergey Kolekonov | ba20398 | 2016-12-21 18:32:17 +0400 | [diff] [blame] | 123 | outputTable = runOpenstackCommand(cmd, client, path) |
Ales Komarek | e11e879 | 2016-12-28 09:42:25 +0100 | [diff] [blame] | 124 | output = python.parseTextTable(outputTable, 'item', 'prettytable', path) |
Sergey Kolekonov | ba20398 | 2016-12-21 18:32:17 +0400 | [diff] [blame] | 125 | return output |
| 126 | } |
| 127 | |
| 128 | /** |
| 129 | * Get OpenStack Keystone token for current credentials |
| 130 | * |
| 131 | * @param env Connection parameters for OpenStack API endpoint |
| 132 | * @param path Optional path to the custom virtualenv |
| 133 | */ |
| 134 | def createHeatEnv(file, environment = [], original_file = null) { |
| 135 | if (original_file) { |
| 136 | envString = readFile file: original_file |
Tomáš Kukrál | 0302944 | 2017-02-21 17:14:29 +0100 | [diff] [blame] | 137 | } else { |
Sergey Kolekonov | ba20398 | 2016-12-21 18:32:17 +0400 | [diff] [blame] | 138 | envString = "parameters:\n" |
| 139 | } |
Tomáš Kukrál | 0302944 | 2017-02-21 17:14:29 +0100 | [diff] [blame] | 140 | |
Tomáš Kukrál | c3964e5 | 2017-02-22 14:07:37 +0100 | [diff] [blame] | 141 | p = entries(environment) |
Tomáš Kukrál | b1fe964 | 2017-02-22 11:21:17 +0100 | [diff] [blame] | 142 | for (int i = 0; i < p.size(); i++) { |
| 143 | envString = "${envString} ${p.get(i)[0]}: ${p.get(i)[1]}\n" |
Sergey Kolekonov | ba20398 | 2016-12-21 18:32:17 +0400 | [diff] [blame] | 144 | } |
Tomáš Kukrál | 0302944 | 2017-02-21 17:14:29 +0100 | [diff] [blame] | 145 | |
Tomáš Kukrál | e19ddea | 2017-02-21 11:09:40 +0100 | [diff] [blame] | 146 | echo("writing to env file:\n${envString}") |
Sergey Kolekonov | ba20398 | 2016-12-21 18:32:17 +0400 | [diff] [blame] | 147 | writeFile file: file, text: envString |
| 148 | } |
| 149 | |
| 150 | /** |
| 151 | * Create new OpenStack Heat stack |
| 152 | * |
| 153 | * @param env Connection parameters for OpenStack API endpoint |
| 154 | * @param template HOT template for the new Heat stack |
| 155 | * @param environment Environmentale parameters of the new Heat stack |
| 156 | * @param name Name of the new Heat stack |
| 157 | * @param path Optional path to the custom virtualenv |
| 158 | */ |
| 159 | def createHeatStack(client, name, template, params = [], environment = null, path = null) { |
iberezovskiy | d4240b5 | 2017-02-20 17:18:28 +0400 | [diff] [blame] | 160 | def python = new com.mirantis.mk.Python() |
Sergey Kolekonov | ba20398 | 2016-12-21 18:32:17 +0400 | [diff] [blame] | 161 | templateFile = "${env.WORKSPACE}/template/template/${template}.hot" |
| 162 | if (environment) { |
| 163 | envFile = "${env.WORKSPACE}/template/env/${template}/${name}.env" |
| 164 | envSource = "${env.WORKSPACE}/template/env/${template}/${environment}.env" |
| 165 | createHeatEnv(envFile, params, envSource) |
| 166 | } |
| 167 | else { |
| 168 | envFile = "${env.WORKSPACE}/template/${name}.env" |
| 169 | createHeatEnv(envFile, params) |
| 170 | } |
| 171 | cmd = "heat stack-create -f ${templateFile} -e ${envFile} ${name}" |
| 172 | dir("${env.WORKSPACE}/template/template") { |
| 173 | outputTable = runOpenstackCommand(cmd, client, path) |
| 174 | } |
Ales Komarek | e11e879 | 2016-12-28 09:42:25 +0100 | [diff] [blame] | 175 | output = python.parseTextTable(outputTable, 'item', 'prettytable', path) |
Sergey Kolekonov | ba20398 | 2016-12-21 18:32:17 +0400 | [diff] [blame] | 176 | |
| 177 | i = 1 |
Ales Komarek | dce8b47 | 2016-12-30 16:56:07 +0100 | [diff] [blame] | 178 | |
Sergey Kolekonov | ba20398 | 2016-12-21 18:32:17 +0400 | [diff] [blame] | 179 | while (true) { |
| 180 | status = getHeatStackStatus(client, name, path) |
| 181 | echo("[Heat Stack] Status: ${status}, Check: ${i}") |
Ales Komarek | dce8b47 | 2016-12-30 16:56:07 +0100 | [diff] [blame] | 182 | |
| 183 | if (status.indexOf('CREATE_FAILED') != -1) { |
Sergey Kolekonov | ba20398 | 2016-12-21 18:32:17 +0400 | [diff] [blame] | 184 | info = getHeatStackInfo(client, name, path) |
| 185 | throw new Exception(info.stack_status_reason) |
| 186 | } |
Ales Komarek | dce8b47 | 2016-12-30 16:56:07 +0100 | [diff] [blame] | 187 | else if (status.indexOf('CREATE_COMPLETE') != -1) { |
Sergey Kolekonov | ba20398 | 2016-12-21 18:32:17 +0400 | [diff] [blame] | 188 | info = getHeatStackInfo(client, name, path) |
| 189 | echo(info.stack_status_reason) |
| 190 | break |
| 191 | } |
| 192 | sh('sleep 5s') |
| 193 | i++ |
| 194 | } |
| 195 | echo("[Heat Stack] Status: ${status}") |
| 196 | } |
| 197 | |
| 198 | /** |
Jakub Josef | db4baf2 | 2017-05-10 15:16:09 +0200 | [diff] [blame] | 199 | * Returns list of stacks for stack name filter |
| 200 | * |
| 201 | * @param client Connection parameters for OpenStack API endpoint |
| 202 | * @param filter Stack name filter |
| 203 | * @param path Optional path to the custom virtualenv |
| 204 | */ |
| 205 | def getStacksForNameContains(client, filter, path = null){ |
Jakub Josef | 6465fca | 2017-05-10 16:09:20 +0200 | [diff] [blame] | 206 | cmd = 'heat stack-list | awk \'NR>3 {print $4}\' | sed \'$ d\' | grep ' + filter + '|| true' |
Jakub Josef | db4baf2 | 2017-05-10 15:16:09 +0200 | [diff] [blame] | 207 | return runOpenstackCommand(cmd, client, path).trim().tokenize("\n") |
| 208 | } |
| 209 | |
| 210 | |
| 211 | /** |
Jakub Josef | 5e238a2 | 2017-04-19 16:35:15 +0200 | [diff] [blame] | 212 | * Get list of stack names with given stack status |
| 213 | * |
Jakub Josef | db4baf2 | 2017-05-10 15:16:09 +0200 | [diff] [blame] | 214 | * @param client Connection parameters for OpenStack API endpoint |
Jakub Josef | 5e238a2 | 2017-04-19 16:35:15 +0200 | [diff] [blame] | 215 | * @param status Stack status |
| 216 | * @param path Optional path to the custom virtualenv |
| 217 | */ |
| 218 | def getStacksWithStatus(client, status, path = null) { |
| 219 | cmd = 'heat stack-list -f stack_status='+status+' | awk \'NR>3 {print $4}\' | sed \'$ d\'' |
| 220 | return runOpenstackCommand(cmd, client, path).trim().tokenize("\n") |
| 221 | } |
| 222 | |
| 223 | /** |
Sergey Kolekonov | ba20398 | 2016-12-21 18:32:17 +0400 | [diff] [blame] | 224 | * Get life cycle status for existing OpenStack Heat stack |
| 225 | * |
| 226 | * @param env Connection parameters for OpenStack API endpoint |
| 227 | * @param name Name of the managed Heat stack instance |
| 228 | * @param path Optional path to the custom virtualenv |
| 229 | */ |
| 230 | def getHeatStackStatus(client, name, path = null) { |
| 231 | cmd = 'heat stack-list | awk -v stack='+name+' \'{if ($4==stack) print $6}\'' |
| 232 | return runOpenstackCommand(cmd, client, path) |
| 233 | } |
| 234 | |
| 235 | /** |
| 236 | * Get info about existing OpenStack Heat stack |
| 237 | * |
| 238 | * @param env Connection parameters for OpenStack API endpoint |
| 239 | * @param name Name of the managed Heat stack instance |
| 240 | * @param path Optional path to the custom virtualenv |
| 241 | */ |
| 242 | def getHeatStackInfo(env, name, path = null) { |
iberezovskiy | d4240b5 | 2017-02-20 17:18:28 +0400 | [diff] [blame] | 243 | def python = new com.mirantis.mk.Python() |
Sergey Kolekonov | ba20398 | 2016-12-21 18:32:17 +0400 | [diff] [blame] | 244 | cmd = "heat stack-show ${name}" |
| 245 | outputTable = runOpenstackCommand(cmd, env, path) |
Ales Komarek | e11e879 | 2016-12-28 09:42:25 +0100 | [diff] [blame] | 246 | output = python.parseTextTable(outputTable, 'item', 'prettytable', path) |
Sergey Kolekonov | ba20398 | 2016-12-21 18:32:17 +0400 | [diff] [blame] | 247 | return output |
| 248 | } |
| 249 | |
| 250 | /** |
| 251 | * Get existing OpenStack Heat stack output parameter |
| 252 | * |
| 253 | * @param env Connection parameters for OpenStack API endpoint |
| 254 | * @param name Name of the managed Heat stack |
| 255 | * @param parameter Name of the output parameter |
| 256 | * @param path Optional path to the custom virtualenv |
| 257 | */ |
| 258 | def getHeatStackOutputParam(env, name, outputParam, path = null) { |
| 259 | cmd = "heat output-show ${name} ${outputParam}" |
| 260 | output = runOpenstackCommand(cmd, env, path) |
Ales Komarek | eedc222 | 2017-01-03 10:10:03 +0100 | [diff] [blame] | 261 | echo("${cmd}: ${output}") |
Ales Komarek | 7ebd006 | 2017-01-03 10:59:29 +0100 | [diff] [blame] | 262 | return "${output}".substring(1, output.length()-1) |
Sergey Kolekonov | ba20398 | 2016-12-21 18:32:17 +0400 | [diff] [blame] | 263 | } |
| 264 | |
| 265 | /** |
| 266 | * List all resources from existing OpenStack Heat stack |
| 267 | * |
| 268 | * @param env Connection parameters for OpenStack API endpoint |
| 269 | * @param name Name of the managed Heat stack instance |
| 270 | * @param path Optional path to the custom virtualenv |
| 271 | */ |
| 272 | def getHeatStackResources(env, name, path = null) { |
iberezovskiy | d4240b5 | 2017-02-20 17:18:28 +0400 | [diff] [blame] | 273 | def python = new com.mirantis.mk.Python() |
Sergey Kolekonov | ba20398 | 2016-12-21 18:32:17 +0400 | [diff] [blame] | 274 | cmd = "heat resource-list ${name}" |
| 275 | outputTable = runOpenstackCommand(cmd, env, path) |
Ales Komarek | e11e879 | 2016-12-28 09:42:25 +0100 | [diff] [blame] | 276 | output = python.parseTextTable(outputTable, 'list', 'prettytable', path) |
Sergey Kolekonov | ba20398 | 2016-12-21 18:32:17 +0400 | [diff] [blame] | 277 | return output |
| 278 | } |
| 279 | |
| 280 | /** |
| 281 | * Get info about resource from existing OpenStack Heat stack |
| 282 | * |
| 283 | * @param env Connection parameters for OpenStack API endpoint |
| 284 | * @param name Name of the managed Heat stack instance |
| 285 | * @param path Optional path to the custom virtualenv |
| 286 | */ |
| 287 | def getHeatStackResourceInfo(env, name, resource, path = null) { |
iberezovskiy | d4240b5 | 2017-02-20 17:18:28 +0400 | [diff] [blame] | 288 | def python = new com.mirantis.mk.Python() |
Sergey Kolekonov | ba20398 | 2016-12-21 18:32:17 +0400 | [diff] [blame] | 289 | cmd = "heat resource-show ${name} ${resource}" |
| 290 | outputTable = runOpenstackCommand(cmd, env, path) |
Ales Komarek | e11e879 | 2016-12-28 09:42:25 +0100 | [diff] [blame] | 291 | output = python.parseTextTable(outputTable, 'item', 'prettytable', path) |
Sergey Kolekonov | ba20398 | 2016-12-21 18:32:17 +0400 | [diff] [blame] | 292 | return output |
| 293 | } |
| 294 | |
| 295 | /** |
| 296 | * Update existing OpenStack Heat stack |
| 297 | * |
| 298 | * @param env Connection parameters for OpenStack API endpoint |
| 299 | * @param name Name of the managed Heat stack instance |
| 300 | * @param path Optional path to the custom virtualenv |
| 301 | */ |
| 302 | def updateHeatStack(env, name, path = null) { |
iberezovskiy | d4240b5 | 2017-02-20 17:18:28 +0400 | [diff] [blame] | 303 | def python = new com.mirantis.mk.Python() |
Sergey Kolekonov | ba20398 | 2016-12-21 18:32:17 +0400 | [diff] [blame] | 304 | cmd = "heat stack-update ${name}" |
| 305 | outputTable = runOpenstackCommand(cmd, env, path) |
Ales Komarek | e11e879 | 2016-12-28 09:42:25 +0100 | [diff] [blame] | 306 | output = python.parseTextTable(outputTable, 'item', 'prettytable', path) |
Sergey Kolekonov | ba20398 | 2016-12-21 18:32:17 +0400 | [diff] [blame] | 307 | return output |
| 308 | } |
| 309 | |
| 310 | /** |
| 311 | * Delete existing OpenStack Heat stack |
| 312 | * |
| 313 | * @param env Connection parameters for OpenStack API endpoint |
| 314 | * @param name Name of the managed Heat stack instance |
| 315 | * @param path Optional path to the custom virtualenv |
| 316 | */ |
| 317 | def deleteHeatStack(env, name, path = null) { |
| 318 | cmd = "heat stack-delete ${name}" |
| 319 | outputTable = runOpenstackCommand(cmd, env, path) |
| 320 | } |
| 321 | |
| 322 | /** |
| 323 | * Return list of servers from OpenStack Heat stack |
| 324 | * |
| 325 | * @param env Connection parameters for OpenStack API endpoint |
| 326 | * @param name Name of the managed Heat stack instance |
| 327 | * @param path Optional path to the custom virtualenv |
| 328 | */ |
| 329 | def getHeatStackServers(env, name, path = null) { |
| 330 | resources = heatGetStackResources(env, name, path) |
| 331 | servers = [] |
| 332 | for (resource in resources) { |
| 333 | if (resource.resource_type == 'OS::Nova::Server') { |
| 334 | resourceName = resource.resource_name |
| 335 | server = heatGetStackResourceInfo(env, name, resourceName, path) |
| 336 | servers.add(server.attributes.name) |
| 337 | } |
| 338 | } |
| 339 | echo("[Stack ${name}] Servers: ${servers}") |
| 340 | return servers |
| 341 | } |