diff options
author | Kris Zentner <kzentner@section6.net> | 2018-03-07 13:46:53 -0800 |
---|---|---|
committer | Tim Smith <tsmith@chef.io> | 2018-03-14 14:43:30 -0700 |
commit | f8b2331b0c3a127bc4a88a2726e8de1b86b144df (patch) | |
tree | bc737a8d77861ff06c02e66d59519782c4b28de7 | |
parent | a13fac461a299322a838b9d5d3be17fc78e9e285 (diff) | |
download | ohai-azure.tar.gz |
Fixing so this works with and without network jsonazure
Was missing passing metadata to the network metadata initialization function
-rw-r--r-- | lib/ohai/plugins/azure.rb | 5 |
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 |