Uploaded image for project: 'Puppet Development Kit'
  1. Puppet Development Kit
  2. PDK-1273

PDK YAML validator dies with a stack trace on a valid YAML file

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PDK 1.9.1
    • Component/s: None
    • Environment:

      Running Mac OS X 10.13.6 (High Sierra)

      PDK version 1.9.0

    • Template:
    • Acceptance Criteria:
      Hide

      The pdk validate yaml command should not exit with a stack trace when valid YAML files are in the module directory.

      Show
      The pdk validate yaml command should not exit with a stack trace when valid YAML files are in the module directory.
    • Method Found:
      Needs Assessment
    • Zendesk Ticket IDs:
      33965
    • Zendesk Ticket Count:
      1
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      "pdk validate yaml" now supports the use of Ruby symbols (e.g. :foo) in YAML files.
    • QA Risk Assessment:
      Needs Assessment

      Description

      The command pdk validate yaml dies with a stack trace when a certain valid YAML file is in the module directory. I have reproduced the problem with the following steps:

      • pdk new module yaml_test and accept the default answers (in ~/.pdk/cache/answers.json).
      • change directory into yaml_test
      • pdk new class yaml_test

      At this point I can run pdk validate and it runs to completion as expected. Next, add the following YAML as the file nodes.yaml:

      ---
      domainname: 'vagrant'
      ssh_base_port: 4322
      nodes:
        - name: 'bionic'
          aliases: []
          ip: "192.168.50.16"
          ports:
            - host_suffix: 28
              guest: 22
      #        id: :ssh
          memory: 512
          box: "ubuntu-1804"
          boxurl: "http://osrepo/boxes/vagrant/ubuntu-1804/"
          bootstrap: "scripts/provision-node.sh" 

      It should still run pdk validate without incident. Then remove the comment character (#) from the line that has id: :ssh. Now pdk validate should fail with a stack trace.

      That YAML file is a cut-down version of a file that is included in a Vagrantfile to create some virtual machines used for module development and testing.

       

        Attachments

          Activity

            People

            • Assignee:
              tim.sharpe Tim Sharpe
              Reporter:
              davide David Eckelkamp
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Zendesk Support