ggiamarchi / vagrant-openstack-provider

Use Vagrant to manage OpenStack Cloud instances.
MIT License
247 stars 101 forks source link

don't break get_ip_address if static IP is assigned #285

Closed johnswanson closed 7 years ago

johnswanson commented 8 years ago

If the first network in the config specifies a static IP address, then the key to look up in addresses is network[:name], not the bare network hash.

coveralls commented 8 years ago

Coverage Status

Coverage decreased (-0.04%) to 92.188% when pulling 99896ed37dd9409e23d2ee63987395ebb4b5e794 on johnswanson:master into 7a5d972f05834a86849b36bd0fc8dd8123eb378b on ggiamarchi:master.

ggiamarchi commented 8 years ago

@johnswanson testing your code, i realize there's still non covered situations. As you pointed out, in the Vagrantfile a network can be either a string or a hash. But that's not all. When it's a string, it can be either the network name or the network id. And when it's a hash, it can contains either a key name or a key id.

If i summarize,

First network format before your PR your PR
String name / "private-net"
String ID / "adbcd056-2a60-4404-aa2b-c31bd9d2841a"
Hash with name / { name: "private-net" }
Hash with ID / { id: "adbcd056-2a60-4404-aa2b-c31bd9d2841a" }

If you meant to fix the whole issue it would be awesome, but as long as your patch partially fix it i don't have any objection for merging it and create an issue for the rest.

Let me know your preference.