1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[openstack] Updated mocks for quota, image, tenant and volumes

Conflicts:
	lib/fog/openstack/requests/compute/get_quota.rb
	lib/fog/openstack/requests/compute/get_quota_defaults.rb
	lib/fog/openstack/requests/identity/list_roles_for_user_on_tenant.rb
This commit is contained in:
Philip Mark M. Deazeta 2012-09-01 02:03:28 +08:00 committed by Nelvin Driz
parent baca5dd34b
commit a36abe3c52
3 changed files with 30 additions and 31 deletions

View file

@ -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

View file

@ -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

View file

@ -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] }