Last active
December 16, 2015 20:29
-
-
Save krames/5492359 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if Fog::VERSION == "1.10.1" | |
| Fog::Logger.warning "PATCHING Fog::Compute::RackspaceV2::Server to allow networks to be created" | |
| require 'rubygems' | |
| require 'fog' | |
| module Fog | |
| module Compute | |
| class RackspaceV2 | |
| class Server < Fog::Compute::Server | |
| def create(options) | |
| requires :name, :image_id, :flavor_id | |
| options[:networks] ||= attributes[:networks] | |
| options[:disk_config] = disk_config unless disk_config.nil? | |
| options[:metadata] = metadata.to_hash unless @metadata.nil? | |
| options[:personality] = personality unless personality.nil? | |
| if options[:networks] | |
| options[:networks].map! { |id| { :uuid => id } } | |
| end | |
| data = service.create_server(name, image_id, flavor_id, 1, 1, options) | |
| merge_attributes(data.body['server']) | |
| true | |
| end | |
| end | |
| end | |
| end | |
| end | |
| else | |
| Fog::Logger.warning "PATCHING Fog::Compute::RackspaceV2::Server - does not apply for #{Fog::VERSION}. Please remove it." | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment