Uploaded image for project: 'Modules'
  1. Modules
  2. MODULES-10021

mysql: stringify command output

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: mysql
    • Labels:
      None
    • Template:
      MODULES Bug Template
    • Method Found:
      Needs Assessment
    • QA Risk Assessment:
      Needs Assessment

      Description

      PUP-7808 changed puppet resource <type> --to_yaml so that it emits structured data correctly, using pops serialization. One unintended side-effect is that any module whose instances method returns resources whose values are the result of executed commands (via Puppet::Util::Execution.execute or the commands provider framework) will be emitted as:

      mysql_database:
        PERCONA_SCHEMA:
          ensure: present
          charset: !ruby/string:Puppet::Util::Execution::ProcessOutput utf8
          collate: !ruby/string:Puppet::Util::Execution::ProcessOutput utf8_general_ci
      

      While it is technically valid YAML, it is not parseable if the puppet classes aren't loaded or tags aren't stripped.

      We will fix puppet in PUP-10105 to not emit ProcessOutput classes (and likely warn).

      But the mysql module should call ProcessOutput#to_s when creating resources. I think this could be handled when calling mysql_raw(...).to_s in https://github.com/puppetlabs/puppetlabs-mysql/blob/ab9292eab45e81e693738e93f0eaf55d9bfd7752/lib/puppet/provider/mysql.rb#L100-L118

      /cc Thomas Honey, Henrik Lindberg

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            josh Josh Cooper
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Zendesk Support