puppetlabs/facter — pull request #351 by ahpook (2012-11-09 00:42:29+00:00)
Title: (#17493) Safer handling of EC2 'open' calls

Prior to this commit, both the Facter::Util::EC2..can_connect?
and the Facter::EC2.metadata calls had unsafe 'open' calls which
would raise uncaught exceptions if something unexpected happened.

This commit wraps both of them in begin/rescue/end blocks to
prevent facter (and therefore puppet) from exiting unexpectedly.