Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-3657

Using create_resource or some other Ruby methodology for creating resources allows for invalid resource references

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Compiler
    • Labels:
    • Template:
    • Team:
      Puppet Developer Experience

      Description

      See #17842 for an example of this:

      <http://projects.puppetlabs.com/issues/17842#note-5>

      The problem is that this is invalid in the parser:

          file { '/tmp/foo':
            ensure => present,
            require => [ Mymodule::foo['bar'] ],
          }
      

      But this works successfully:

          create_resources('file', { '/usr/local/homeaway/api-favorites-ustst1-jdk/java' => {
                                       ensure => present,
                                       require => "Mymodule::foo[bar]" }})
      

      However, in PuppetDB we are more strict and the second case fails with an invalid relationship error - we can fix the error message on our end, but this still shouldn't be allowed I believe.

      The question is - should this be fixed in the internals so people tapping resource creation (like within create_resources) get an error or something else? Or perhaps fixed in create_resources? Its basically just an inconsistency between that methodology and what the parser enforces.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              redmine.exporter redmine.exporter
              QA Contact:
              Kurt Wall
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Zendesk Support