Uploaded image for project: 'PuppetDB'
  1. PuppetDB
  2. PDB-246

One item array are casted to String when stored in puppetdb

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Won't Fix
    • Affects Version/s: PDB 1.5.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
    • Template:

      Description

      When I try to create an exported resource (in my exemple a nginx::resource::vhost) with some parameters containing a one-item array, it is casted to String in puppetdb :

      @@nginx::resource::vhost { 'my resource':
      ensure => present,
      server_name => ['first item'],
      listen_port => 9200,
      proxy => "http://${::fqdn}"
      }

      In puppetdb I get :

      puppetdb=# select * from resource_params where resource = '0e27f67d04b10bf659967bc8ecc704fa767bf278';

      resource | name | value
      -------------------------------------------------------------------------------------------------
      0e27f67d04b10bf659967bc8ecc704fa767bf278 | ensure | "present"
      0e27f67d04b10bf659967bc8ecc704fa767bf278 | server_name | "first item"
      0e27f67d04b10bf659967bc8ecc704fa767bf278 | listen_port | "9200"
      0e27f67d04b10bf659967bc8ecc704fa767bf278 | proxy | "http://myvm.internal-log-es"
      (4 rows)

      puppetdb=# select * from catalog_resources where type like '%Nginx%';
      puppetdb=# select * from resource_params where resource = '927ec49e9a0f96a5d38f9d87cc247ebc03d2fea6';
      resource | name | value
      ------------------------------------------------------------------------------------
      927ec49e9a0f96a5d38f9d87cc247ebc03d2fea6 | ensure | "present"
      927ec49e9a0f96a5d38f9d87cc247ebc03d2fea6 | members | ["first item","second item"]
      (2 rows)

      The second select is just to show that 1+ items array are correctly stored.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              Sp4rKy Maxence Dunnewind
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support