def create_image(attributes)
response = Excon::Response.new
response.status = 201
image_id = Fog::Mock.random_hex(32)
image = self.data[:images][image_id] = {
'name' => attributes['name'] || attributes[:name],
'size' => Fog::Mock.random_numbers(8).to_i,
'min_disk' => 0,
'disk_format' => attributes['disk_format'] || attributes[:disk_format] || 'raw',
'created_at' => Time.now.to_s,
'container_format' => attributes['container_format'] || attributes[:container_format] || 'bare',
'deleted_at' => nil,
'updated_at' => Time.now.to_s,
'checksum' => Fog::Mock.random_hex(32),
'id' => image_id,
'deleted' => false,
'protected' => false,
'is_public' => false,
'status' => 'queued',
'min_ram' => 0,
'owner' => attributes['owner'] || attributes[:owner],
'properties' => attributes['properties'] || attributes[:properties] || {}
}
response.body = { 'image'=> image }
response
end