[PDB-1629] Relationships on resource aliases don't work with Puppet 4.x Created: 2015/06/17  Updated: 2015/08/04  Resolved: 2015/06/23

Status: Closed
Project: PuppetDB
Component/s: None
Affects Version/s: PDB 2.3.5
Fix Version/s: PDB 2.3.6

Type: Bug Priority: Normal
Reporter: Erik Dalén Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Story Points: 2
Sprint: PuppetDB 2015-07-01

 Description   

When doing a dependency on a resource alias the puppetdb-terminus fails in the synthesize_edges method when caching the catalog.

The following code snippet illustrates the issue:

package { foo:
  ensure => installed,
  alias=>bar,
}
service{ baz:
  ensure => running,
  require => Package[bar]
}

It fails silently, but with some debug output added I can see it fails with the exception

Puppet::Error: Invalid relationship: Service[baz] { require => Package[bar] }, because Package[bar] doesn't seem to be in the catalog



 Comments   
Comment by Erik Dalén [ 2015/06/17 ]

Seems like the calls to

resource['parameters']['alias']

need to be

Array(resource['parameters'][:alias])

in Puppet 4.x.

Comment by Ken Barber [ 2015/06/17 ]

Confirmed: https://gist.github.com/kbarber/5aa82b6f6a5a3f525c70

Generated at Sun Aug 25 04:11:12 PDT 2019 using JIRA 7.7.1#77002-sha1:e75ca93d5574d9409c0630b81c894d9065296414.