Skip to content

Commit

Permalink
updating cloud plugin to populate azure private_ip as it's currently nil
Browse files Browse the repository at this point in the history
  • Loading branch information
rshade committed Jan 4, 2017
1 parent 3a8a4e1 commit fd6e010
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/ohai/plugins/cloud.rb
Expand Up @@ -208,6 +208,7 @@ def on_azure?
# 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"]
Expand Down
6 changes: 6 additions & 0 deletions spec/unit/plugins/cloud_spec.rb
Expand Up @@ -162,6 +162,12 @@
@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
Expand Down

0 comments on commit fd6e010

Please sign in to comment.