summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Shade <rshade@rightscale.com>2017-01-04 15:50:06 -0600
committerBryan McLellan <btm@loftninjas.org>2017-01-04 18:59:46 -0500
commit60c7fd2a22cc95a8e52e9c0579ed7d49c531635a (patch)
tree17bec1669c0502f91330e834e78d72b0869e4f0e
parent3a8a4e1781430a6ee3a6f00cc8c6f0967f693c22 (diff)
downloadohai-60c7fd2a22cc95a8e52e9c0579ed7d49c531635a.tar.gz
updating cloud plugin to populate azure private_ip as it's currently nilohai13
Signed-off-by: Richard Shade <rshade@rightscale.com>
-rw-r--r--lib/ohai/plugins/cloud.rb1
-rw-r--r--spec/unit/plugins/cloud_spec.rb6
2 files changed, 7 insertions, 0 deletions
diff --git a/lib/ohai/plugins/cloud.rb b/lib/ohai/plugins/cloud.rb
index 23084631..c204f292 100644
--- a/lib/ohai/plugins/cloud.rb
+++ b/lib/ohai/plugins/cloud.rb
@@ -208,6 +208,7 @@ Ohai.plugin(:Cloud) do
# Fill cloud hash with azure values
def get_azure_values
cloud[:vm_name] = azure["vm_name"]
+ cloud[:private_ips] << azure["private_ip"]
cloud[:public_ips] << azure["public_ip"]
cloud[:public_ipv4] = azure["public_ip"]
cloud[:public_fqdn] = azure["public_fqdn"]
diff --git a/spec/unit/plugins/cloud_spec.rb b/spec/unit/plugins/cloud_spec.rb
index d90465b1..9fa2ba7d 100644
--- a/spec/unit/plugins/cloud_spec.rb
+++ b/spec/unit/plugins/cloud_spec.rb
@@ -162,6 +162,12 @@ describe Ohai::System, "plugin cloud" do
@plugin[:azure] = Mash.new()
end
+ it "populates cloud private ip" do
+ @plugin[:azure]["private_ip"] = "10.0.0.1"
+ @plugin.run
+ expect(@plugin[:cloud][:private_ips][0]).to eq(@plugin[:azure]["private_ip"])
+ end
+
it "populates cloud public ip" do
@plugin[:azure]["public_ip"] = "174.129.150.8"
@plugin.run