lib/ohai/plugins/docker.rb in ohai-16.3.2 vs lib/ohai/plugins/docker.rb in ohai-16.4.11

- old
+ new

@@ -14,12 +14,10 @@ # See the License for the specific language governing permissions and # limitations under the License. # Ohai.plugin(:Docker) do - require "json" - provides "docker" depends "virtualization" def docker_info_json so = shell_out("docker info --format '{{json .}}'") @@ -48,9 +46,11 @@ docker[:networking][:bridge_nf_ipv6_iptables] = shellout_data["BridgeNfIp6tables"] docker[:swarm] = shellout_data["Swarm"] end collect_data do + require "json" unless defined?(JSON) + if virtualization[:systems][:docker] docker_ohai_data(docker_info_json) end end end