summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2022-02-25 17:49:45 -0800
committerGitHub <noreply@github.com>2022-02-25 17:49:45 -0800
commit28a58f4d5fc9df0042d253d5b22c50e4a3b7a632 (patch)
tree92cd6100538e607d5af53050b30fc8d67e5291a5
parent6c6d3eda5dcec623bfe8080a491eaaa48b501fe4 (diff)
parent77929155a6f82b7e65db624b37766bf9fb5f81fb (diff)
downloadohai-28a58f4d5fc9df0042d253d5b22c50e4a3b7a632.tar.gz
Merge pull request #1735 from casperisfine/patch-1
Stop checking encoding names
-rw-r--r--lib/ohai/plugins/ec2.rb4
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