Skip to content

Commit

Permalink
describe_instance_attribute should not fail when an instance has a bl…
Browse files Browse the repository at this point in the history
…ank UserData
  • Loading branch information
konstantin committed Oct 25, 2011
1 parent dc27231 commit 584b7be
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/ec2/right_ec2_instances.rb
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,8 @@ def describe_instance_attribute(instance_id, attribute)
'InstanceId' => instance_id,
'Attribute' => attribute)
value = request_info(link, QEc2DescribeInstanceAttributeParser.new(:logger => @logger))
attribute == "userData" ? Base64.decode64(value) : value
value = Base64.decode64(value) if attribute == "userData" && !value.right_blank?
value
rescue Exception
on_exception
end
Expand Down

0 comments on commit 584b7be

Please sign in to comment.