Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Jimdo/aws-sdk-ruby into J…
Browse files Browse the repository at this point in the history
…imdo-master

Conflicts:
	ChangeLog
	lib/aws/ec2/client.rb
  • Loading branch information
trevorrowe committed Jan 4, 2013
2 parents 0d0c3dc + d335242 commit ca458a5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# language governing permissions and limitations under the License.

---
:api_version: '2012-07-20'
:api_version: '2012-12-01'
:operations:
- :name: ActivateLicense
:method: :activate_license
Expand Down
2 changes: 1 addition & 1 deletion lib/aws/ec2/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3529,7 +3529,7 @@ class Client < Core::QueryClient

# end client methods #

define_client_methods('2012-07-20')
define_client_methods('2012-12-01')

end
end
Expand Down
6 changes: 6 additions & 0 deletions lib/aws/ec2/route_table/route.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ def initialize route_table, details

@target = (internet_gateway || instance || network_interface)

@origin = { 'CreateRoute' => :create_route, 'CreateRouteTable' => :create_route_table, 'EnableVgwRoutePropagation' => :enable_vgw_route_propagation }[details.origin]

@state = details.state.to_sym

end
Expand All @@ -80,6 +82,10 @@ def initialize route_table, details
# network interface.
attr_reader :target

# @return [Symbol] Returns the origin (:create_route,
# :create_route_table or :enable_vgw_route_propagation)
attr_reader :origin

# @return [Symbol] Returns the state (:active or :blackhole).
attr_reader :state

Expand Down
6 changes: 6 additions & 0 deletions spec/aws/ec2/route_table_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -243,37 +243,43 @@ def stub_tags(resp, tags)
route_set << {
:destination_cidr_block => 'cidr-block-1',
:gateway_id => 'igw-123',
:origin => 'CreateRoute',
:state => 'active',
}

route_set << {
:destination_cidr_block => 'cidr-block-2',
:instance_id => 'i-123',
:instance_owner_id => 'owner-id',
:origin => 'CreateRouteTable',
:state => 'pending',
}

route_set << {
:destination_cidr_block => 'cidr-block-3',
:network_interface_id => 'ni-123',
:origin => 'EnableVgwRoutePropagation',
:state => 'foo',
}

routes = route_table.routes

routes[0].destination_cidr_block.should == 'cidr-block-1'
routes[0].target.should == InternetGateway.new('igw-123', :config => config)
routes[0].origin.should == :create_route
routes[0].state.should == :active
routes[0].target.should == routes[0].internet_gateway

routes[1].destination_cidr_block.should == 'cidr-block-2'
routes[1].target.should == Instance.new('i-123', :config => config)
routes[1].origin.should == :create_route_table
routes[1].state.should == :pending
routes[1].target.should == routes[1].instance
routes[1].instance.owner_id.should == 'owner-id'

routes[2].destination_cidr_block.should == 'cidr-block-3'
routes[2].target.should == NetworkInterface.new('ni-123', :config => config)
routes[2].origin.should == :enable_vgw_route_propagation
routes[2].state.should == :foo
routes[2].target.should == routes[2].network_interface

Expand Down

0 comments on commit ca458a5

Please sign in to comment.