puppetlabs/puppetlabs-postgresql — pull request #545 by timdaman (2014-12-09 05:33:35+00:00)
Title: Postgis dep

Prevent pick() of postgis_version failure

globals.pp always trys to identify the default what version of postgis even when postgis is not being installed.

The problem comes when using a custom packaged version of postsql that does not match the default major.minor version of postgresql for the current OS. In that case default_postgis _version is set to undef If postgis_version is also undefined the pick statement tthat set globals_postgis_version fails.

This changes the pick statement in globals.pp to an if statment than can pass undefs safely.
It changes params.pp to pass undef as a package name if postgis_version is equal to undef.
Finally I changed the postgis.pp class to give a meanful error message when no valid package name can be found.

I performed simple testing of this code but I lack the facilities to fullly exercise it. Additionally I do not know rspec. As a result I a submitting the code for a pull request right now incase someone finds it useful or wishes to add the missing test. I plan to learn rspec in the next couple months as I need it for a project and at that time, if the pull request is still waiting, I will add tests then.