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

PDK incorrectly parse Variant data type

    XMLWordPrintable

    Details

    • Template:
    • Team:
      Puppet Developer Experience
    • Method Found:
      Needs Assessment
    • CS Priority:
      Reviewed
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      `pdk validate` will no longer warn about quoted boolean values in Puppet code, since this is no longer prohibited by the Puppet language Style Guide.
    • QA Risk Assessment:
      Needs Assessment

      Description

      PDK validate incorrectly throws warning message on Variant data type

      Variant[Boolean, Enum['true', 'false', 'running', 'stopped']]
      

      PDK will give warning message quoted boolean value found which is misleading. The above 'true' and 'false' value are Enum data type that have to be in String. The warning message may prompt user to remove the single quote.

      Variant[Boolean, Enum['true', 'false', 'running', 'stopped']]
      

      This causes a problem as PE is not able to parse the environment classes (/puppet/v3/environment_classes?environment=production) and throw exception error message like below.

      <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/> <title>Error 500 Server Error</title> </head> <body><h2>HTTP ERROR 500</h2> <p>Problem accessing /puppet/v3/environment_classes. Reason: <pre> Server Error</pre></p><h3>Caused by:</h3><pre>clojure.lang.ExceptionInfo: Output of manifest-info-from-jruby-&gt;manifest-info-for-json does not match schema: {:classes [{:params [{:type (not (instance? java.lang.String nil))}]}]} {:type :schema.core/error, :schema (conditional puppetlabs.services.master.master-core/fn--39719 {:path Str, :error Str} puppetlabs.services.master.master-core/fn--39721 {:path Str, :classes [{:name Str, :params [{:name Str, (optional-key :type) Str, (optional-key :default_source) Str, (optional-key :default_literal) Any}]}]}), :value {:classes ({:name &quot;test&quot;, :params ({:default_source &quot;$puppetdb::params::puppetdb_service_status&quot;, :name &quot;puppetdb_service_status&quot;, :type nil})}), :path &quot;/etc/puppetlabs/code/environments/production/modules/test/manifests/init.pp&quot;}, :error {:classes [{:params [{:type (not (instance? java.lang.String nil))}]}]}}

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            halim.wijaya Halim Wijaya
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support