diff options
author | Tim Smith <tsmith@chef.io> | 2022-02-25 17:49:45 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-25 17:49:45 -0800 |
commit | 28a58f4d5fc9df0042d253d5b22c50e4a3b7a632 (patch) | |
tree | 92cd6100538e607d5af53050b30fc8d67e5291a5 | |
parent | 6c6d3eda5dcec623bfe8080a491eaaa48b501fe4 (diff) | |
parent | 77929155a6f82b7e65db624b37766bf9fb5f81fb (diff) | |
download | ohai-28a58f4d5fc9df0042d253d5b22c50e4a3b7a632.tar.gz |
Merge pull request #1735 from casperisfine/patch-1
Stop checking encoding names
-rw-r--r-- | lib/ohai/plugins/ec2.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ohai/plugins/ec2.rb b/lib/ohai/plugins/ec2.rb index eb9fa480..79c124fe 100644 --- a/lib/ohai/plugins/ec2.rb +++ b/lib/ohai/plugins/ec2.rb @@ -142,8 +142,8 @@ Ohai.plugin(:EC2) do ec2[:account_id] = fetch_dynamic_data["accountId"] ec2[:availability_zone] = fetch_dynamic_data["availabilityZone"] ec2[:region] = fetch_dynamic_data["region"] - # ASCII-8BIT is equivalent to BINARY in this case - if ec2[:userdata] && ec2[:userdata].encoding.to_s == "ASCII-8BIT" + + if ec2[:userdata] && ec2[:userdata].encoding == Encoding::BINARY logger.trace("Plugin EC2: Binary UserData Found. Storing in base64") ec2[:userdata] = Base64.encode64(ec2[:userdata]) end |