mitchellh / vagrant-rackspace

Use Vagrant to manage Rackspace Cloud instances.
MIT License
236 stars 155 forks source link

support for provisioning unlisted images #99

Closed michaelsbradleyjr closed 10 years ago

michaelsbradleyjr commented 10 years ago

If the image isn't found in the list-collection, try to look it up directly using the get method. This allows provisioning "unlisted" images by ID, such as those indicated in the CoreOS documentation.

krames commented 10 years ago

Good catch!!

What do you think about moving all of this logic into find_matching? We could pass env[:rackspace_compute].flavors and env[:rackspace_compute].images in for parameters. We would call get if the name parameter anything other than a regex. If it was a regex, we could just use the same behavior.

I only mention this be cause it would be one less network call.

michaelsbradleyjr commented 10 years ago

Reducing the number of network calls sounds good to me, though the present solution has something going for it in the way of simplicity.

I'll admit this is my first ever pull request in the Ruby language – a quick hack to get something working for one of my current projects. I'll understand if you want to close without merging and instead "substitute" a pull request along the lines you suggested; the combo-call implementation is probably better left to someone more familiar with the language.

krames commented 10 years ago

@michaelsbradleyjr Let me try to take a stab at this.

krames commented 10 years ago

@michaelsbradleyjr I just accepted another PR which makes one less network call than this approach. Thanks for bringing this issue to my attention!