alphagov/vcloud-walker — pull request #80 by dcarley (2014-05-29 15:52:27+00:00)
Title: [#63370428] Fix handling of vApps without networks

If a vApp fails during creation then it can be left as an empty shell
without any VMs or attached networks. The lack of networks causes
vcloud-walker to raise exceptions because certain parts of the vApp hash
aren't populated and we try to do operations on `nil` objects.

Mimic these with a unit test that modifies the Fog hash according to what
I've seen from the API. We probably only need to fix the handling of
`:NetworkConfig`. It should be OK to set `@network_section` to nil.

We originally thought that this might be caused by the lack of VMs but the
stacktrace in the story and further testing proves that it is only the
networks.

---

Default to an empty array if :NetworkConfigSection isn't available because
the vApp doesn't have any networks attached. This satifisies the input for
`#extract_network_config` which expects an array.