Closed johnswanson closed 7 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.
If the first network in the config specifies a static IP address, then the key to look up in
addresses
isnetwork[:name]
, not the bare network hash.