diff --git a/lib/fog/openstack/models/compute/security_group.rb b/lib/fog/openstack/models/compute/security_group.rb index 7b629e35c..3359f97f3 100644 --- a/lib/fog/openstack/models/compute/security_group.rb +++ b/lib/fog/openstack/models/compute/security_group.rb @@ -17,7 +17,7 @@ module Fog def save requires :name, :description data = connection.create_security_group(name, description) - merge_attributes(data.body['security_group']) + merge_attributes(data.body['security_groups']) true end diff --git a/lib/fog/openstack/requests/compute/list_security_groups.rb b/lib/fog/openstack/requests/compute/list_security_groups.rb index 812ddee55..5c8f4c5b0 100644 --- a/lib/fog/openstack/requests/compute/list_security_groups.rb +++ b/lib/fog/openstack/requests/compute/list_security_groups.rb @@ -19,7 +19,7 @@ module Fog class Mock def list_security_groups - self.data[:security_groups] = [ + self.data[:security_groups] ||= [ { "rules" => [ { "from_port" => 44, "group" => {}, @@ -57,7 +57,7 @@ module Fog "name" => "test", "description" => "this is a test" } - ] unless self.data.empty? + ] Excon::Response.new( :body => { 'security_groups' => self.data[:security_groups] }, :headers => {