title: Groovy read yaml file returns array
body: <p>yml_1:</p>
  
  <pre><code>server
    port: 1023
  </code></pre>
  
  <p>yml_2:</p>
  
  <pre><code>server
    port: 4001
  </code></pre>
  
  <p>I use <code>readYaml</code> in Jenkins to read the YAML file:</p>
  
  <pre><code>void checkService(waitTime) {
      def conf = readYaml file: "./${CURRENT_STAGE}/src/main/resources/${CONF_NAME}"
      String port = conf.server.port.toString()
  
      timeout(waitTime) {
          waitUntil {
             script {
               def r = sh script: "wget -q http://${HOST_NAME}:${port}/info -O /dev/null", returnStatus: true
               return (r == 0)
             }
          }
      }
  }
  </code></pre>
  
  <p>It works fine in first yml, the url returns <a href="http://hostname:1023/info" rel="nofollow noreferrer">http://hostname:1023/info</a>,
  but it returns array if calls checkService() again for second yml file: <a href="http://hostname:[4001]/info" rel="nofollow noreferrer">http://hostname:[4001]/info</a></p>
  
  <p>Where is the problem?</p>