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

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

    Details

    • Type: Task
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PUP 5.3.3
    • Fix Version/s: PUP 5.3.4
    • Component/s: None
    • Labels:
      None
    • Template:
    • Acceptance Criteria:
      Hide

      Method is updated
      Unit and acceptance tests are updated and pass

      Show
      Method is updated Unit and acceptance tests are updated and pass
    • Sub-team:
    • Team:
      Platform Core
    • Sprint:
      Platform Core KANBAN
    • Release Notes:
      Not Needed
    • QA Risk Assessment:
      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

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

              Dates

              • Created:
                Updated:
                Resolved:

                Zendesk Support