Call to undefined gsub on line 47

If you assign smart vars to puppet classes, it returns them as a hash in the YAML as opposed to a simple array [].
This fix ensures that Foreman return values are converted to the expected array.