(#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.