From 399f9a32684e3753ab48916a0a5013f737f16b2a Mon Sep 17 00:00:00 2001 From: Lincoln Stoll Date: Tue, 17 May 2011 14:28:20 +1000 Subject: [PATCH] [ninefold|compute] use lowest network ID as default, correct assignment. --- lib/fog/compute/models/ninefold/server.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/fog/compute/models/ninefold/server.rb b/lib/fog/compute/models/ninefold/server.rb index e999b6064..aba301c52 100644 --- a/lib/fog/compute/models/ninefold/server.rb +++ b/lib/fog/compute/models/ninefold/server.rb @@ -136,7 +136,8 @@ module Fog if networks.empty? raise "No networks. Please create one, or specify a network ID" else - networkids = networks[0]['id'] + # use the network with the lowest ID - the safe default + self.networkids = networks.sort {|x,y| x['id'] <=> y['id']}[0]['id'] end end