Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updating cloud plugin to populate azure private_ip as it's currently nil #937

Merged
merged 1 commit into from Jan 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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