ansible/ansible — pull request #3806 by neomantra (2013-08-09 16:00:49+00:00)
Title: digital_ocean #3438: use get instead of [] to prevent KeyError

This works on my system and seems correct by inspection. The reporter has not confirmed if this fixes his problem, but this code is less error-prone.

----
The existing code was using:
a[b][c[d]]
where a[b] would always exist and c[d] would always exist.
But the nested index would not alway exist, particularly when a DigitalOcean item disapeared.

This changes that nested index to a `get` and properly handles None results.

This bug was present in two spots in this file.