lib/fog/aws/requests/compute/create_subnet.rb in fog-1.6.0 vs lib/fog/aws/requests/compute/create_subnet.rb in fog-1.7.0

- old
+ new

@@ -19,11 +19,11 @@ # * 'requestId'<~String> - Id of request # * 'subnet'<~Array>: # * 'subnetId'<~String> - The Subnet's ID # * 'state'<~String> - The current state of the Subnet. ['pending', 'available'] # * 'cidrBlock'<~String> - The CIDR block the Subnet covers. - # * 'AvailableIpAddressCount'<~Integer> - The number of unused IP addresses in the subnet (the IP addresses for any stopped + # * 'AvailableIpAddressCount'<~Integer> - The number of unused IP addresses in the subnet (the IP addresses for any stopped # instances are considered unavailable) # * 'AvailabilityZone'<~String> - The Availability Zone the subnet is in # * 'tagSet'<~Array>: Tags assigned to the resource. # * 'key'<~String> - Tag's key # * 'value'<~String> - Tag's value @@ -37,20 +37,20 @@ :parser => Fog::Parsers::Compute::AWS::CreateSubnet.new }.merge!(options)) end end - + class Mock def create_subnet(vpcId, cidrBlock, options = {}) av_zone = options['AvailabilityZone'].nil? ? 'us-east-1c' : options['AvailabilityZone'] Excon::Response.new.tap do |response| if cidrBlock && vpcId response.status = 200 self.data[:subnets].push({ 'subnetId' => Fog::AWS::Mock.request_id, 'state' => 'pending', - 'vpcId' => Fog::AWS::Mock.request_id, + 'vpcId' => vpcId, 'cidrBlock' => cidrBlock, 'availableIpAddressCount' => "255", 'availabilityZone' => av_zone, 'tagSet' => {} })