sous-chefs / aws

Development repository for the aws cookbook
https://supermarket.chef.io/cookbooks/aws
Apache License 2.0
610 stars 554 forks source link

Incorrect list length comparison #444

Closed aisachenka closed 3 years ago

aisachenka commented 3 years ago

:ghost: Brief Description

FATAL: NoMethodError: undefined method '>' for ["eu", "central", "1b"]:Array I'm getting this error after upgrading to 9.0.1 version when I'm trying to use aws_ssm_parameter_store resource. The problem is only reproducible in 9.0.1 version, with 9.0.0 works fine. I think it's related to commit split function returns the list of string therefore length must be used, isn't it? The line if node['ec2']['placement_availability_zone'].split('-') > 3 should be if node['ec2']['placement_availability_zone'].split('-').length() > 3

:pancakes: Cookbook version

9.0.1

:woman_cook: Chef-Infra Version

Tested with 16.16.13 and 17.7.29

:tophat: Platform details

Tested only on Ubuntu, but most probably it's a common problem

Steps To Reproduce

Steps to reproduce the behavior:

aws_ssm_parameter_store "/test/path" do
  return_key 'value'
  with_decryption true
  action :get
end