diff --git a/lib/fog/openstack/requests/identity/create_tenant.rb b/lib/fog/openstack/requests/identity/create_tenant.rb index ca81b4680..b854fa55d 100644 --- a/lib/fog/openstack/requests/identity/create_tenant.rb +++ b/lib/fog/openstack/requests/identity/create_tenant.rb @@ -20,10 +20,10 @@ module Fog response.status = [200, 204][rand(1)] response.body = { 'tenant' => { - 'id' => '1', - 'description' => 'Has access to everything', + 'id' => "#{ Fog::Mock.random_hex(32) }", + 'description' => attributes['description'], 'enabled' => true, - 'name' => 'admin' + 'name' => attributes['name'] } } response diff --git a/lib/fog/openstack/requests/image/create_image.rb b/lib/fog/openstack/requests/image/create_image.rb index 860620969..702a7c41f 100644 --- a/lib/fog/openstack/requests/image/create_image.rb +++ b/lib/fog/openstack/requests/image/create_image.rb @@ -52,30 +52,29 @@ module Fog def create_image(attributes) response = Excon::Response.new response.status = 201 - response.body = {"image"=> - {"name"=>"new image", - "size"=>0, - "min_disk"=>0, - "disk_format"=>nil, - "created_at"=>"2012-02-24T06:45:00", - "container_format"=>nil, - "deleted_at"=>nil, - "updated_at"=>"2012-02-24T06:45:00", - "checksum"=>nil, - "id"=>"e41304f3-2453-42b4-9829-2e220a737395", - "deleted"=>false, - "protected"=>false, - "is_public"=>false, - "status"=>"queued", - "min_ram"=>0, - "owner"=>"728ecc7c10614a1faa6fbabd1a68a4a0", - "properties"=>{} - } - } + response.body = { + "image"=> { + "name" => attributes[:name], + "size" => 0, + "min_disk" => 0, + "disk_format" => attributes[:disk_format], + "created_at" => Time.now, + "container_format" => attributes['container_format'], + "deleted_at" => nil, + "updated_at" => Time.now, + "checksum" => nil, + "id" => "#{ Fog::Mock.random_hex(32) }", + "deleted" => false, + "protected" => false, + "is_public" => attributes[:is_public], + "status" => "queued", + "min_ram" => 0, + "owner" => attributes[:owner], + "properties" => attributes[:properties] + } + } response - end - end end end diff --git a/lib/fog/openstack/requests/volume/list_volumes.rb b/lib/fog/openstack/requests/volume/list_volumes.rb index 09ca99e3e..7c9bdd4c7 100644 --- a/lib/fog/openstack/requests/volume/list_volumes.rb +++ b/lib/fog/openstack/requests/volume/list_volumes.rb @@ -22,26 +22,26 @@ module Fog response.status = 200 self.data[:volumes] ||= [ { "status" => "available", - "display_description" => "", + "display_description" => "test 1 desc", "availability_zone" => "nova", "display_name" => "test 1", "attachments" => [{}], "volume_type" => nil, "snapshot_id" => nil, "size" => 1, - "id" => 6, - "created_at" => "2012-03-30 05:31:00.655058", + "id" => 1, + "created_at" => Time.now, "metadata" => {} }, { "status" => "available", - "display_description" => "", + "display_description" => "test 2 desc", "availability_zone" => "nova", "display_name" => "test 2", "attachments" => [{}], "volume_type" => nil, "snapshot_id" => nil, "size" => 1, - "id" => 8, - "created_at" => "2012-03-30 16:14:55.582717", + "id" => 2, + "created_at" => Time.now, "metadata" => {} } ] response.body = { 'volumes' => self.data[:volumes] }