puppetlabs/puppet — pull request #1257 by bodepd (2012-11-05 08:46:03+00:00)
Title: (#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 resources that are already reps
are expressed as an array.

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.