lib/fog/openstack/requests/compute/detach_volume.rb in fog-maestrodev-1.8.0.20130114204828 vs lib/fog/openstack/requests/compute/detach_volume.rb in fog-maestrodev-1.14.0.20130806165225
- old
+ new
@@ -12,13 +12,19 @@
end
end
class Mock
+
def detach_volume(server_id, attachment_id)
response = Excon::Response.new
- response.status = 202
- response
+ if self.data[:volumes][attachment_id] &&
+ self.data[:volumes][attachment_id]['attachments'].reject! { |attachment| attachment['serverId'] == server_id }
+ response.status = 202
+ response
+ else
+ raise Fog::Compute::OpenStack::NotFound
+ end
end
end
end
end