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

Update Puppet::Resource::Catalog.alias to use Puppet::Util::Errors.error_location()

    XMLWordPrintable

Details

    • Task
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • PUP 5.3.3
    • PUP 5.3.4
    • None
    • None
    • Hide

      Method is updated
      Unit and acceptance tests are updated and pass

      Show
      Method is updated Unit and acceptance tests are updated and pass
    • Platform Core
    • Platform Core KANBAN
    • Not Needed
    • No Action

    Description

      The 'Puppet::Resource::Catalog.alias' method prints out the location of an error and should be updated to use Puppet::Util::Errors.error_location() instead so that we're being consistent:

        def alias(resource, key)
      ...
          if existing = @resource_table[newref]
            return if existing == resource
            resource_declaration = " at #{resource.file}:#{resource.line}" if resource.file and resource.line
            existing_declaration = " at #{existing.file}:#{existing.line}" if existing.file and existing.line
            #TRANSLATORS "resource" here is a Puppet type and should not be translated
            msg = _("Cannot alias %{ref} to %{key}%{resource_declaration}; resource %{newref} already declared%{existing_declaration}") % { ref: ref, key: key.inspect, resource_declaration: resource_declaration, newref: newref.inspect, existing_declaration: existing_declaration }
            raise ArgumentError, msg
          end
      

      Attachments

        Activity

          People

            eric.delaney Eric Delaney
            eric.delaney Eric Delaney
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Zendesk Support