HomePhorge

(#7422) Support arrow syntax with metaparams
0524a0a00f5dUnpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

(#7422) Support arrow syntax with metaparams

Attempts to combine the arrow syntax with
metaparams lead to the following error message:

Error: undefined method `<<' for {}:Hash

For example, the following code:

Notify['one'] -> Notify['three']

notify { 'one':
  before => Notify['two']
}
notify { 'two': }

notify { ['three', 'four']: }

Causes this issue. This is because relationships
appended with the -> syntax assume that the current
list of dependencies are an array.

Given that, it is not surprising that the following
code is valid at the moment:

Notify['one'] -> Notify['three']

notify { 'one':
  before => Notify['two', 'four']
}
notify { 'two': }

notify { ['three', 'four']: }

In this case, the dependency resources are already
expressed as an array before the arrow syntax appends
the additional dep.

This commit converts everything to an array before
trying to append additional relationships to that
array. The fact that the second code snippet already
works demonstrates that Puppet already supports
appending additional refs to an array of refs.

Details

Provenance
Dan Bode <dan@puppetlabs.com>Authored on
Jeff McCune <jeff@puppetlabs.com>Committed on Nov 5 2012, 11:16 PM
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPUa18e46e79602: Merge pull request #1255 from MosesMendoza/maint/2.7.x/packaging_fixes
Branches
Unknown
Tags
Unknown

Event Timeline

Jeff McCune <jeff@puppetlabs.com> committed rPU0524a0a00f5d: (#7422) Support arrow syntax with metaparams (authored by Dan Bode <dan@puppetlabs.com>).Nov 5 2012, 11:16 PM