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

PDK throws YAML error if bolt config file is misconfigured/invalid

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PDK 1.12.0
    • Component/s: None
    • Template:
    • Method Found:
      Needs Assessment
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Fixed an issue where a badly formatted Bolt analytics config file would cause an un-configured installation of PDK to exit with an error.
    • QA Risk Assessment:
      Needs Assessment

      Description

      From https://gist.githubusercontent.com/ginodambrosio/2c13fc79a151c1c7c486f6149040d23a/raw/eccd7a9c8f9956f88b0b17e8a014f7b1cb99ec28/gistfile1.txt

      PS C:\Users\Administrator> pdk new module -d
      C:/Program Files/Puppet Labs/DevelopmentKit/private/ruby/2.4.5/lib/ruby/gems/2.4.0/gems/pdk-1.11.0/lib/pdk/config/yam
      b:13:in `rescue in parse_data': Syntax error when loading C:/Users/Administrator/.puppetlabs/bolt/analytics.yaml: con
      l characters are not allowed  (PDK::Config::LoadError)
              from C:/Program Files/Puppet Labs/DevelopmentKit/private/ruby/2.4.5/lib/ruby/gems/2.4.0/gems/pdk-1.11.0/lib/p
      config/yaml.rb:6:in `parse_data'
              from C:/Program Files/Puppet Labs/DevelopmentKit/private/ruby/2.4.5/lib/ruby/gems/2.4.0/gems/pdk-1.11.0/lib/p
      config/namespace.rb:246:in `data'
              from C:/Program Files/Puppet Labs/DevelopmentKit/private/ruby/2.4.5/lib/ruby/gems/2.4.0/gems/pdk-1.11.0/lib/p
      config/namespace.rb:104:in `fetch'
              from C:/Program Files/Puppet Labs/DevelopmentKit/private/ruby/2.4.5/lib/ruby/gems/2.4.0/gems/pdk-1.11.0/lib/p
      config.rb:29:in `block (4 levels) in user'
              from C:/Program Files/Puppet Labs/DevelopmentKit/private/ruby/2.4.5/lib/ruby/gems/2.4.0/gems/pdk-1.11.0/lib/p
      config/value.rb:85:in `default'
              from C:/Program Files/Puppet Labs/DevelopmentKit/private/ruby/2.4.5/lib/ruby/gems/2.4.0/gems/pdk-1.11.0/lib/p
      config/namespace.rb:263:in `block in default_config_value'
              from C:/Program Files/Puppet Labs/DevelopmentKit/private/ruby/2.4.5/lib/ruby/gems/2.4.0/gems/pdk-1.11.0/lib/p
      config/namespace.rb:87:in `[]'
              from C:/Program Files/Puppet Labs/DevelopmentKit/private/ruby/2.4.5/lib/ruby/gems/2.4.0/gems/pdk-1.11.0/lib/p
      rb:17:in `analytics'
              from C:/Program Files/Puppet Labs/DevelopmentKit/private/ruby/2.4.5/lib/ruby/gems/2.4.0/gems/pdk-1.11.0/lib/p
      cli/util.rb:233:in `analytics_screen_view'
              from C:/Program Files/Puppet Labs/DevelopmentKit/private/ruby/2.4.5/lib/ruby/gems/2.4.0/gems/pdk-1.11.0/lib/p
      cli/new/module.rb:24:in `block (2 levels) in <module:CLI>'
              from C:/Program Files/Puppet Labs/DevelopmentKit/private/ruby/2.4.5/lib/ruby/gems/2.4.0/gems/cri-2.10.1/lib/c
      command.rb:329:in `run_this'
              from C:/Program Files/Puppet Labs/DevelopmentKit/private/ruby/2.4.5/lib/ruby/gems/2.4.0/gems/cri-2.10.1/lib/c
      command.rb:269:in `run'
              from C:/Program Files/Puppet Labs/DevelopmentKit/private/ruby/2.4.5/lib/ruby/gems/2.4.0/gems/cri-2.10.1/lib/c
      command.rb:287:in `run'
              from C:/Program Files/Puppet Labs/DevelopmentKit/private/ruby/2.4.5/lib/ruby/gems/2.4.0/gems/cri-2.10.1/lib/c
      command.rb:287:in `run'
              from C:/Program Files/Puppet Labs/DevelopmentKit/private/ruby/2.4.5/lib/ruby/gems/2.4.0/gems/pdk-1.11.0/lib/p
      cli.rb:55:in `run'
              from C:/Program Files/Puppet Labs/DevelopmentKit/private/ruby/2.4.5/lib/ruby/gems/2.4.0/gems/pdk-1.11.0/exe/p
      6:in `<top (required)>'
              from C:/PROGRA~1/PUPPET~1/DEVELO~1/private/ruby/2.4.5/bin/pdk:23:in `load'
              from C:/PROGRA~1/PUPPET~1/DEVELO~1/private/ruby/2.4.5/bin/pdk:23:in `<main>'
      

        Attachments

          Activity

            People

            Assignee:
            tim.sharpe Tim Sharpe
            Reporter:
            glenn.sarti Glenn Sarti
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support