Permalink
Browse files

[aws_cpi] yet another aws sdk quirk that needs a workaround

  • Loading branch information...
1 parent 0e9baa1 commit 09760eac3f5572227ef58b542708cf8aead9f8a8 @pmenglund pmenglund committed Mar 14, 2013
Showing with 4 additions and 1 deletion.
  1. +4 −1 bosh_aws_cpi/lib/cloud/aws/resource_wait.rb
@@ -134,7 +134,10 @@ def for_resource(args)
state = nil
Bosh::Common.retryable(tries: tries, sleep: sleep_cb, on: errors, ensure: ensure_cb ) do
Bosh::AwsCloud::ResourceWait.task_checkpoint # from config
- state = resource.call(state_method)
+
+ # for some obscure reason AWS::EC2::Subnet does not have the call method,
+ # so a little hackery is required :(
+ state = resource.instance_of?(AWS::EC2::Subnet) ? resource.__send__(state_method) : resource.call(state_method)
if state == :error || state == :failed
raise Bosh::Clouds::CloudError, "#{desc} state is #{state}, expected #{target_state}"

0 comments on commit 09760ea

Please sign in to comment.