summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKris Zentner <kzentner@section6.net>2018-03-07 13:46:53 -0800
committerGitHub <noreply@github.com>2018-03-07 13:46:53 -0800
commit1d681aaeab6bde8c9053e7e81fdf73da10de4b81 (patch)
tree1defe625f331ab71b7678854f017c34e52c847db
parent0bd29471f34c61d0dc27dabfb79e5d48791d5019 (diff)
downloadohai-1d681aaeab6bde8c9053e7e81fdf73da10de4b81.tar.gz
Fixing so this works with and without network json
Was missing passing metadata to the network metadata initialization function
-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