summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKris Zentner <kzentner@section6.net>2018-03-07 13:46:53 -0800
committerKris Zentner <krisz@microsoft.com>2018-03-07 14:31:41 -0800
commit0615dc628d3d1db6cf944edc7323bf7daccd83a9 (patch)
tree1defe625f331ab71b7678854f017c34e52c847db
parent71cd12714cba6ba3d31ee863e017f735b15ec1e0 (diff)
downloadohai-0615dc628d3d1db6cf944edc7323bf7daccd83a9.tar.gz
Fixing so this works with and without network json
Was missing passing metadata to the network metadata initialization function Signed-off-by: Kris Zentner <krisz@microsoft.com>
-rw-r--r--lib/ohai/plugins/azure.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/ohai/plugins/azure.rb b/lib/ohai/plugins/azure.rb
index 14cdf63b..4a15dc54 100644
--- a/lib/ohai/plugins/azure.rb
+++ b/lib/ohai/plugins/azure.rb
@@ -74,8 +74,7 @@ Ohai.plugin(:Azure) do
metadata
end
- def initialize_metadata_mash_network
- metadata = Mash.new
+ def initialize_metadata_mash_network(metadata)
metadata["network"] = Mash.new
metadata["network"]["interfaces"] = Mash.new
%w{public_ipv4 local_ipv4 public_ipv6 local_ipv6}.each do |type|
@@ -107,7 +106,7 @@ Ohai.plugin(:Azure) do
# receiving network output is not guaranteed
unless endpoint_data["network"].nil?
- metadata = initialize_metadata_mash_network
+ metadata = initialize_metadata_mash_network(metadata)
# parse out per interface interface IP data
endpoint_data["network"]["interface"].each do |int|
metadata["network"]["interfaces"][int["macAddress"]] = Mash.new