diff options
author | Tim Smith <tsmith@chef.io> | 2018-11-06 12:47:38 -0800 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2020-01-28 11:28:08 -0800 |
commit | 42b04ffceafa3db6681d38d9915fa36449954d85 (patch) | |
tree | 24333e35c68f236fc42141a7e9c09c95a045af1f /lib | |
parent | de71b21a9ed8ea6725f8e4e1eafada0943a33fee (diff) | |
download | chef-42b04ffceafa3db6681d38d9915fa36449954d85.tar.gz |
Update knife status --long to use cloud attributes not ec2 specific attributesstatus_done_right
This way we get the public IP / hostname on Azure, GCE, DigitalOcean, Softlayer, etc.
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/knife/core/status_presenter.rb | 6 | ||||
-rw-r--r-- | lib/chef/knife/status.rb | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/chef/knife/core/status_presenter.rb b/lib/chef/knife/core/status_presenter.rb index 9042350295..b33bd95da4 100644 --- a/lib/chef/knife/core/status_presenter.rb +++ b/lib/chef/knife/core/status_presenter.rb @@ -1,6 +1,6 @@ # # Author:: Nicolas DUPEUX (<nicolas.dupeux@arkea.com>) -# Copyright:: Copyright 2011-2016, Chef Software Inc. +# Copyright:: Copyright 2011-2020, Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -67,8 +67,8 @@ class Chef result["name"] = node["name"] || node.name result["chef_environment"] = node["chef_environment"] - ip = (node["ec2"] && node["ec2"]["public_ipv4"]) || node["ipaddress"] - fqdn = (node["ec2"] && node["ec2"]["public_hostname"]) || node["fqdn"] + ip = (node["cloud"] && node["cloud"]["public_ipv4_addrs"].first) || node["ipaddress"] + fqdn = (node["cloud"] && node["cloud"]["public_hostname"]) || node["fqdn"] result["ip"] = ip if ip result["fqdn"] = fqdn if fqdn result["run_list"] = node.run_list if config["run_list"] diff --git a/lib/chef/knife/status.rb b/lib/chef/knife/status.rb index 074488e003..f157c60b41 100644 --- a/lib/chef/knife/status.rb +++ b/lib/chef/knife/status.rb @@ -1,6 +1,6 @@ # # Author:: Ian Meyer (<ianmmeyer@gmail.com>) -# Copyright:: Copyright 2010-2016, Ian Meyer +# Copyright:: Copyright 2010-2020, Ian Meyer # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -59,7 +59,7 @@ class Chef else opts = { filter_result: { name: ["name"], ipaddress: ["ipaddress"], ohai_time: ["ohai_time"], - ec2: ["ec2"], run_list: ["run_list"], platform: ["platform"], + cloud: ["cloud"], run_list: ["run_list"], platform: ["platform"], platform_version: ["platform_version"], chef_environment: ["chef_environment"] } } end |