summaryrefslogtreecommitdiff
path: root/lib/ohai/mixin
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2017-09-07 22:05:52 -0700
committerTim Smith <tsmith@chef.io>2017-09-07 22:05:52 -0700
commit78af77bfa160b623f63717d555c07bc8afa2b6da (patch)
tree42b538a77c434fdb1ba7cc1ae72e38c91fbd9022 /lib/ohai/mixin
parent00bfd9fd3a2623464cfc899eb57cb618c087cb8e (diff)
downloadohai-78af77bfa160b623f63717d555c07bc8afa2b6da.tar.gz
Return nils on error instead of an empty hash
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib/ohai/mixin')
-rw-r--r--lib/ohai/mixin/azure_metadata.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ohai/mixin/azure_metadata.rb b/lib/ohai/mixin/azure_metadata.rb
index 8c62bb49..9a3765a9 100644
--- a/lib/ohai/mixin/azure_metadata.rb
+++ b/lib/ohai/mixin/azure_metadata.rb
@@ -41,11 +41,11 @@ module Ohai
parser.parse(data)
rescue FFI_Yajl::ParseError
Ohai::Log.warn("Mixin AzureMetadata: Metadata response is NOT valid JSON")
- {}
+ nil
end
else
Ohai::Log.warn("Mixin AzureMetadata: Received resonse code #{response.code} requesting metadata")
- {}
+ nil
end
end
end