This selects the preferred image to use based on a number of conditions
Returns current identifier of the latest version of Ubuntu
The order of preference is:
Only Official Brightbox images
Only Ubuntu images
Latest by name (alphanumeric sort)
Latest by creation date
@note This performs a live query against the API
@return [String] if image matches containing the identifier @return [NilClass] if no image matches
# File lib/fog/brightbox/compute/image_selector.rb, line 30 def latest_ubuntu @images.select do |img| img["official"] == true && img["arch"] == "i686" && img["name"] =~ /ubuntu/ end.sort do |a,b| # Reverse sort so "raring" > "precise" and "13.10" > "13.04" b["name"].downcase <=> a["name"].downcase end.first["id"] rescue nil end
Generated with the Darkfish Rdoc Generator 2.