return nil instead of '' for mocks as well

This commit is contained in:
geemus 2010-05-05 14:22:22 -07:00
parent b0babfe958
commit 7c85a671b2
5 changed files with 8 additions and 8 deletions

View File

@ -27,7 +27,7 @@ module Fog
response.status = 200
public_ip = Fog::AWS::Mock.ip_address
data ={
'instanceId' => '',
'instanceId' => nil,
'publicIp' => public_ip
}
@data[:addresses][public_ip] = data

View File

@ -35,7 +35,7 @@ module Fog
response.status = 200
snapshot_id = Fog::AWS::Mock.snapshot_id
data = {
'progress' => '',
'progress' => nil,
'snapshotId' => snapshot_id,
'startTime' => Time.now,
'status' => 'pending',

View File

@ -43,7 +43,7 @@ module Fog
'attachmentSet' => [],
'createTime' => Time.now,
'size' => size,
'snapshotId' => snapshot_id || '',
'snapshotId' => snapshot_id,
'status' => 'creating',
'volumeId' => volume_id
}

View File

@ -29,7 +29,7 @@ module Fog
response = Excon::Response.new
response.status = 200
if address = @data[:addresses][public_ip]
address['instanceId'] = ''
address['instanceId'] = nil
response.status = 200
response.body = {
'requestId' => Fog::AWS::Mock.request_id,

View File

@ -107,7 +107,7 @@ module Fog
instance = {
'amiLaunchIndex' => i,
'blockDeviceMapping' => [],
'dnsName' => '',
'dnsName' => nil,
'imageId' => image_id,
'instanceId' => instance_id,
'instanceState' => { 'code' => 0, 'name' => 'pending' },
@ -117,17 +117,17 @@ module Fog
'launchTime' => Time.now,
'monitoring' => { 'state' => options['Monitoring.Enabled'] || false },
'placement' => { 'availabilityZone' => options['Placement.AvailabilityZone'] || Fog::AWS::Mock.availability_zone },
'privateDnsName' => '',
'privateDnsName' => nil,
'productCodes' => [],
'ramdiskId' => options['RamdiskId'] || Fog::AWS::Mock.ramdisk_id,
'reason' => '',
'reason' => nil,
'rootDeviceType' => 'instance-store'
}
instances_set << instance
@data[:instances][instance_id] = instance.merge({
'groupSet' => group_set,
'ownerId' => @owner_id,
'privateIpAddress' => '',
'privateIpAddress' => nil,
'reservationId' => reservation_id,
})
end