ohai 8.10.0 → 8.11.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (256) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -2
  3. data/Rakefile +13 -4
  4. data/bin/ohai +3 -4
  5. data/lib/ohai.rb +4 -4
  6. data/lib/ohai/application.rb +7 -6
  7. data/lib/ohai/common/dmi.rb +56 -56
  8. data/lib/ohai/config.rb +12 -8
  9. data/lib/ohai/dsl.rb +3 -3
  10. data/lib/ohai/dsl/plugin.rb +5 -5
  11. data/lib/ohai/dsl/plugin/versionvi.rb +0 -1
  12. data/lib/ohai/dsl/plugin/versionvii.rb +1 -0
  13. data/lib/ohai/hints.rb +1 -1
  14. data/lib/ohai/loader.rb +7 -7
  15. data/lib/ohai/log.rb +1 -1
  16. data/lib/ohai/mash.rb +3 -2
  17. data/lib/ohai/mixin/command.rb +25 -23
  18. data/lib/ohai/mixin/dmi_decode.rb +10 -10
  19. data/lib/ohai/mixin/ec2_metadata.rb +40 -39
  20. data/lib/ohai/mixin/gce_metadata.rb +9 -9
  21. data/lib/ohai/mixin/network_constants.rb +1 -1
  22. data/lib/ohai/mixin/os.rb +3 -3
  23. data/lib/ohai/mixin/seconds_to_human.rb +0 -2
  24. data/lib/ohai/mixin/softlayer_metadata.rb +10 -10
  25. data/lib/ohai/mixin/string.rb +2 -2
  26. data/lib/ohai/plugin_config.rb +1 -1
  27. data/lib/ohai/plugins/aix/cpu.rb +2 -2
  28. data/lib/ohai/plugins/aix/filesystem.rb +2 -2
  29. data/lib/ohai/plugins/aix/memory.rb +2 -2
  30. data/lib/ohai/plugins/aix/network.rb +9 -10
  31. data/lib/ohai/plugins/aix/os.rb +2 -2
  32. data/lib/ohai/plugins/aix/uptime.rb +3 -3
  33. data/lib/ohai/plugins/aix/virtualization.rb +23 -23
  34. data/lib/ohai/plugins/azure.rb +32 -5
  35. data/lib/ohai/plugins/bsd/virtualization.rb +22 -22
  36. data/lib/ohai/plugins/c.rb +3 -3
  37. data/lib/ohai/plugins/chef.rb +1 -1
  38. data/lib/ohai/plugins/cloud.rb +59 -60
  39. data/lib/ohai/plugins/cloud_v2.rb +37 -39
  40. data/lib/ohai/plugins/darwin/cpu.rb +1 -1
  41. data/lib/ohai/plugins/darwin/filesystem2.rb +5 -5
  42. data/lib/ohai/plugins/darwin/memory.rb +5 -6
  43. data/lib/ohai/plugins/darwin/network.rb +7 -7
  44. data/lib/ohai/plugins/darwin/system_profiler.rb +32 -33
  45. data/lib/ohai/plugins/darwin/virtualization.rb +9 -9
  46. data/lib/ohai/plugins/digital_ocean.rb +16 -16
  47. data/lib/ohai/plugins/dmi.rb +6 -6
  48. data/lib/ohai/plugins/dragonflybsd/cpu.rb +2 -2
  49. data/lib/ohai/plugins/dragonflybsd/memory.rb +0 -1
  50. data/lib/ohai/plugins/dragonflybsd/network.rb +4 -4
  51. data/lib/ohai/plugins/dragonflybsd/os.rb +1 -1
  52. data/lib/ohai/plugins/ec2.rb +39 -15
  53. data/lib/ohai/plugins/elixir.rb +1 -1
  54. data/lib/ohai/plugins/erlang.rb +3 -3
  55. data/lib/ohai/plugins/eucalyptus.rb +16 -12
  56. data/lib/ohai/plugins/freebsd/cpu.rb +2 -2
  57. data/lib/ohai/plugins/freebsd/memory.rb +0 -1
  58. data/lib/ohai/plugins/freebsd/network.rb +4 -4
  59. data/lib/ohai/plugins/freebsd/os.rb +1 -1
  60. data/lib/ohai/plugins/gce.rb +6 -6
  61. data/lib/ohai/plugins/hostname.rb +7 -7
  62. data/lib/ohai/plugins/init_package.rb +1 -1
  63. data/lib/ohai/plugins/ip_scopes.rb +9 -9
  64. data/lib/ohai/plugins/java.rb +1 -1
  65. data/lib/ohai/plugins/joyent.rb +7 -7
  66. data/lib/ohai/plugins/kernel.rb +8 -8
  67. data/lib/ohai/plugins/linode.rb +7 -4
  68. data/lib/ohai/plugins/linux/cpu.rb +5 -5
  69. data/lib/ohai/plugins/linux/filesystem.rb +16 -16
  70. data/lib/ohai/plugins/linux/filesystem2.rb +15 -15
  71. data/lib/ohai/plugins/linux/mdadm.rb +3 -3
  72. data/lib/ohai/plugins/linux/network.rb +85 -51
  73. data/lib/ohai/plugins/linux/platform.rb +24 -24
  74. data/lib/ohai/plugins/linux/virtualization.rb +8 -8
  75. data/lib/ohai/plugins/mono.rb +1 -1
  76. data/lib/ohai/plugins/netbsd/cpu.rb +1 -1
  77. data/lib/ohai/plugins/netbsd/network.rb +2 -2
  78. data/lib/ohai/plugins/network.rb +11 -11
  79. data/lib/ohai/plugins/network_listeners.rb +30 -26
  80. data/lib/ohai/plugins/ohai.rb +3 -3
  81. data/lib/ohai/plugins/openbsd/cpu.rb +4 -4
  82. data/lib/ohai/plugins/openbsd/memory.rb +4 -4
  83. data/lib/ohai/plugins/openbsd/network.rb +3 -3
  84. data/lib/ohai/plugins/openstack.rb +12 -12
  85. data/lib/ohai/plugins/os.rb +2 -2
  86. data/lib/ohai/plugins/packages.rb +22 -22
  87. data/lib/ohai/plugins/passwd.rb +4 -4
  88. data/lib/ohai/plugins/powershell.rb +9 -9
  89. data/lib/ohai/plugins/ps.rb +2 -2
  90. data/lib/ohai/plugins/python.rb +1 -1
  91. data/lib/ohai/plugins/rackspace.rb +13 -13
  92. data/lib/ohai/plugins/root_group.rb +4 -4
  93. data/lib/ohai/plugins/ruby.rb +6 -6
  94. data/lib/ohai/plugins/rust.rb +1 -1
  95. data/lib/ohai/plugins/sigar/cpu.rb +1 -1
  96. data/lib/ohai/plugins/sigar/filesystem.rb +1 -1
  97. data/lib/ohai/plugins/sigar/network.rb +13 -13
  98. data/lib/ohai/plugins/sigar/network_route.rb +34 -29
  99. data/lib/ohai/plugins/softlayer.rb +8 -7
  100. data/lib/ohai/plugins/solaris2/cpu.rb +19 -19
  101. data/lib/ohai/plugins/solaris2/dmi.rb +63 -63
  102. data/lib/ohai/plugins/solaris2/filesystem.rb +13 -13
  103. data/lib/ohai/plugins/solaris2/memory.rb +2 -2
  104. data/lib/ohai/plugins/solaris2/network.rb +5 -5
  105. data/lib/ohai/plugins/solaris2/virtualization.rb +18 -18
  106. data/lib/ohai/plugins/solaris2/zpools.rb +1 -1
  107. data/lib/ohai/plugins/ssh_host_key.rb +2 -2
  108. data/lib/ohai/plugins/uptime.rb +4 -5
  109. data/lib/ohai/plugins/virtualbox.rb +2 -2
  110. data/lib/ohai/plugins/virtualization.rb +17 -17
  111. data/lib/ohai/plugins/vmware.rb +2 -2
  112. data/lib/ohai/plugins/windows/cpu.rb +14 -14
  113. data/lib/ohai/plugins/windows/drivers.rb +8 -8
  114. data/lib/ohai/plugins/windows/filesystem.rb +4 -4
  115. data/lib/ohai/plugins/windows/memory.rb +1 -1
  116. data/lib/ohai/plugins/windows/network.rb +10 -10
  117. data/lib/ohai/plugins/windows/platform.rb +1 -2
  118. data/lib/ohai/plugins/windows/virtualization.rb +17 -17
  119. data/lib/ohai/provides_map.rb +7 -7
  120. data/lib/ohai/runner.rb +3 -3
  121. data/lib/ohai/system.rb +21 -20
  122. data/lib/ohai/util/file_helper.rb +1 -2
  123. data/lib/ohai/util/ip_helper.rb +4 -4
  124. data/lib/ohai/util/win32.rb +5 -5
  125. data/lib/ohai/util/win32/group_helper.rb +4 -5
  126. data/lib/ohai/version.rb +1 -1
  127. data/ohai.gemspec +7 -5
  128. data/spec/functional/application_spec.rb +23 -23
  129. data/spec/functional/loader_spec.rb +1 -1
  130. data/spec/functional/plugins/powershell_spec.rb +13 -13
  131. data/spec/functional/plugins/root_group_spec.rb +5 -5
  132. data/spec/ohai_spec.rb +1 -1
  133. data/spec/spec_helper.rb +9 -9
  134. data/spec/support/integration_helper.rb +7 -7
  135. data/spec/support/platform_helpers.rb +1 -1
  136. data/spec/unit/application_spec.rb +17 -17
  137. data/spec/unit/config_spec.rb +2 -2
  138. data/spec/unit/dsl/plugin_spec.rb +28 -28
  139. data/spec/unit/hints_spec.rb +3 -3
  140. data/spec/unit/loader_spec.rb +9 -9
  141. data/spec/unit/mixin/command_spec.rb +5 -5
  142. data/spec/unit/mixin/ec2_metadata_spec.rb +6 -6
  143. data/spec/unit/mixin/softlayer_metadata_spec.rb +19 -23
  144. data/spec/unit/plugin_config_spec.rb +5 -5
  145. data/spec/unit/plugins/abort_spec.rb +3 -3
  146. data/spec/unit/plugins/aix/cpu_spec.rb +1 -1
  147. data/spec/unit/plugins/aix/filesystem_spec.rb +25 -25
  148. data/spec/unit/plugins/aix/hostname_spec.rb +1 -2
  149. data/spec/unit/plugins/aix/kernel_spec.rb +3 -3
  150. data/spec/unit/plugins/aix/memory_spec.rb +8 -8
  151. data/spec/unit/plugins/aix/network_spec.rb +38 -38
  152. data/spec/unit/plugins/aix/os_spec.rb +1 -2
  153. data/spec/unit/plugins/aix/platform_spec.rb +1 -1
  154. data/spec/unit/plugins/aix/uptime_spec.rb +1 -1
  155. data/spec/unit/plugins/aix/virtualization_spec.rb +11 -11
  156. data/spec/unit/plugins/azure_spec.rb +118 -20
  157. data/spec/unit/plugins/bsd/filesystem_spec.rb +1 -1
  158. data/spec/unit/plugins/bsd/virtualization_spec.rb +4 -4
  159. data/spec/unit/plugins/c_spec.rb +12 -12
  160. data/spec/unit/plugins/chef_spec.rb +2 -2
  161. data/spec/unit/plugins/cloud_spec.rb +37 -37
  162. data/spec/unit/plugins/cloud_v2_spec.rb +64 -65
  163. data/spec/unit/plugins/darwin/cpu_spec.rb +1 -2
  164. data/spec/unit/plugins/darwin/filesystem2_spec.rb +7 -7
  165. data/spec/unit/plugins/darwin/filesystem_spec.rb +5 -5
  166. data/spec/unit/plugins/darwin/hostname_spec.rb +1 -4
  167. data/spec/unit/plugins/darwin/kernel_spec.rb +6 -10
  168. data/spec/unit/plugins/darwin/memory_spec.rb +5 -5
  169. data/spec/unit/plugins/darwin/network_spec.rb +352 -353
  170. data/spec/unit/plugins/darwin/platform_spec.rb +1 -2
  171. data/spec/unit/plugins/darwin/system_profiler_spec.rb +3 -3
  172. data/spec/unit/plugins/darwin/virtualization_spec.rb +6 -6
  173. data/spec/unit/plugins/digital_ocean_spec.rb +38 -37
  174. data/spec/unit/plugins/dmi_spec.rb +3 -3
  175. data/spec/unit/plugins/ec2_spec.rb +97 -88
  176. data/spec/unit/plugins/elixir_spec.rb +1 -2
  177. data/spec/unit/plugins/erlang_spec.rb +2 -2
  178. data/spec/unit/plugins/eucalyptus_spec.rb +19 -19
  179. data/spec/unit/plugins/fail_spec.rb +2 -2
  180. data/spec/unit/plugins/freebsd/cpu_spec.rb +14 -14
  181. data/spec/unit/plugins/freebsd/hostname_spec.rb +1 -2
  182. data/spec/unit/plugins/freebsd/kernel_spec.rb +2 -3
  183. data/spec/unit/plugins/freebsd/os_spec.rb +4 -5
  184. data/spec/unit/plugins/freebsd/platform_spec.rb +1 -2
  185. data/spec/unit/plugins/gce_spec.rb +9 -9
  186. data/spec/unit/plugins/go_spec.rb +1 -1
  187. data/spec/unit/plugins/groovy_spec.rb +1 -2
  188. data/spec/unit/plugins/hostname_spec.rb +1 -2
  189. data/spec/unit/plugins/init_package_spec.rb +1 -1
  190. data/spec/unit/plugins/ip_scopes_spec.rb +38 -38
  191. data/spec/unit/plugins/java_spec.rb +52 -1
  192. data/spec/unit/plugins/joyent_spec.rb +9 -11
  193. data/spec/unit/plugins/kernel_spec.rb +11 -12
  194. data/spec/unit/plugins/linode_spec.rb +29 -29
  195. data/spec/unit/plugins/linux/block_device_spec.rb +21 -21
  196. data/spec/unit/plugins/linux/cpu_spec.rb +3 -3
  197. data/spec/unit/plugins/linux/filesystem2_spec.rb +7 -7
  198. data/spec/unit/plugins/linux/filesystem_spec.rb +85 -86
  199. data/spec/unit/plugins/linux/hostname_spec.rb +1 -3
  200. data/spec/unit/plugins/linux/kernel_spec.rb +1 -1
  201. data/spec/unit/plugins/linux/lsb_spec.rb +1 -2
  202. data/spec/unit/plugins/linux/mdadm_spec.rb +4 -4
  203. data/spec/unit/plugins/linux/memory_spec.rb +29 -33
  204. data/spec/unit/plugins/linux/network_spec.rb +463 -245
  205. data/spec/unit/plugins/linux/platform_spec.rb +64 -65
  206. data/spec/unit/plugins/linux/uptime_spec.rb +1 -2
  207. data/spec/unit/plugins/linux/virtualization_spec.rb +42 -42
  208. data/spec/unit/plugins/lua_spec.rb +1 -2
  209. data/spec/unit/plugins/mono_spec.rb +1 -2
  210. data/spec/unit/plugins/netbsd/hostname_spec.rb +1 -2
  211. data/spec/unit/plugins/netbsd/kernel_spec.rb +1 -2
  212. data/spec/unit/plugins/netbsd/platform_spec.rb +1 -1
  213. data/spec/unit/plugins/network_spec.rb +118 -118
  214. data/spec/unit/plugins/nodejs_spec.rb +1 -1
  215. data/spec/unit/plugins/ohai_spec.rb +1 -1
  216. data/spec/unit/plugins/ohai_time_spec.rb +1 -2
  217. data/spec/unit/plugins/openbsd/hostname_spec.rb +1 -2
  218. data/spec/unit/plugins/openbsd/kernel_spec.rb +1 -2
  219. data/spec/unit/plugins/openbsd/platform_spec.rb +1 -2
  220. data/spec/unit/plugins/openstack_spec.rb +35 -37
  221. data/spec/unit/plugins/os_spec.rb +7 -8
  222. data/spec/unit/plugins/packages_spec.rb +118 -118
  223. data/spec/unit/plugins/passwd_spec.rb +18 -18
  224. data/spec/unit/plugins/perl_spec.rb +1 -1
  225. data/spec/unit/plugins/php_spec.rb +4 -4
  226. data/spec/unit/plugins/platform_spec.rb +8 -9
  227. data/spec/unit/plugins/powershell_spec.rb +3 -3
  228. data/spec/unit/plugins/python_spec.rb +1 -1
  229. data/spec/unit/plugins/rackspace_spec.rb +66 -68
  230. data/spec/unit/plugins/root_group_spec.rb +26 -26
  231. data/spec/unit/plugins/ruby_spec.rb +14 -15
  232. data/spec/unit/plugins/rust_spec.rb +2 -2
  233. data/spec/unit/plugins/sigar/network_route_spec.rb +36 -36
  234. data/spec/unit/plugins/softlayer_spec.rb +10 -10
  235. data/spec/unit/plugins/solaris2/cpu_spec.rb +20 -21
  236. data/spec/unit/plugins/solaris2/dmi_spec.rb +5 -6
  237. data/spec/unit/plugins/solaris2/filesystem.rb +5 -5
  238. data/spec/unit/plugins/solaris2/hostname_spec.rb +1 -1
  239. data/spec/unit/plugins/solaris2/kernel_spec.rb +3 -3
  240. data/spec/unit/plugins/solaris2/memory_spec.rb +5 -5
  241. data/spec/unit/plugins/solaris2/network_spec.rb +7 -8
  242. data/spec/unit/plugins/solaris2/platform_spec.rb +1 -1
  243. data/spec/unit/plugins/solaris2/virtualization_spec.rb +3 -5
  244. data/spec/unit/plugins/solaris2/zpools_spec.rb +6 -6
  245. data/spec/unit/plugins/ssh_host_keys_spec.rb +1 -1
  246. data/spec/unit/plugins/virtualbox_spec.rb +19 -19
  247. data/spec/unit/plugins/vmware_spec.rb +28 -28
  248. data/spec/unit/plugins/windows/cpu_spec.rb +46 -48
  249. data/spec/unit/plugins/windows/memory_spec.rb +5 -5
  250. data/spec/unit/plugins/windows/virtualization_spec.rb +163 -163
  251. data/spec/unit/provides_map_spec.rb +10 -10
  252. data/spec/unit/runner_spec.rb +10 -10
  253. data/spec/unit/system_spec.rb +19 -19
  254. data/spec/unit/util/file_helper_spec.rb +5 -6
  255. data/spec/unit/util/ip_helper_spec.rb +39 -39
  256. metadata +31 -4
@@ -17,7 +17,7 @@
17
17
  # limitations under the License.
18
18
  #
19
19
 
20
- require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper.rb')
20
+ require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
21
21
 
22
22
  describe Ohai::System, "BSD filesystem plugin" do
23
23
  let(:plugin) { get_plugin("bsd/filesystem") }
@@ -16,7 +16,7 @@
16
16
  # limitations under the License.
17
17
  #
18
18
 
19
- require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper.rb')
19
+ require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
20
20
 
21
21
  describe Ohai::System, "BSD virtualization plugin" do
22
22
  before(:each) do
@@ -24,7 +24,7 @@ describe Ohai::System, "BSD virtualization plugin" do
24
24
  allow(@plugin).to receive(:collect_os).and_return(:freebsd)
25
25
  allow(@plugin).to receive(:shell_out).with("sysctl -n security.jail.jailed").and_return(mock_shell_out(0, "0", ""))
26
26
  allow(@plugin).to receive(:shell_out).with("#{ Ohai.abs_path( "/sbin/kldstat" )}").and_return(mock_shell_out(0, "", ""))
27
- allow(@plugin).to receive(:shell_out).with("jls -n").and_return(mock_shell_out(0, "",""))
27
+ allow(@plugin).to receive(:shell_out).with("jls -n").and_return(mock_shell_out(0, "", ""))
28
28
  allow(@plugin).to receive(:shell_out).with("sysctl -n hw.model").and_return(mock_shell_out(0, "", ""))
29
29
  end
30
30
 
@@ -39,7 +39,7 @@ describe Ohai::System, "BSD virtualization plugin" do
39
39
 
40
40
  it "detects we are hosting jails" do
41
41
  # from http://www.freebsd.org/doc/handbook/jails-application.html
42
- @jails = "JID IP Address Hostname Path\n 3 192.168.3.17 ns.example.org /home/j/ns\n 2 192.168.3.18 mail.example.org /home/j/mail\n 1 62.123.43.14 www.example.org /home/j/www"
42
+ @jails = "JID IP Address Hostname Path\n 3 192.168.3.17 ns.example.org /home/j/ns\n 2 192.168.3.18 mail.example.org /home/j/mail\n 1 62.123.43.14 www.example.org /home/j/www"
43
43
  allow(@plugin).to receive(:shell_out).with("jls -n").and_return(mock_shell_out(0, @jails, ""))
44
44
  @plugin.run
45
45
  expect(@plugin[:virtualization][:system]).to eq("jail")
@@ -86,7 +86,7 @@ OUT
86
86
 
87
87
  context "when on a QEMU guest" do
88
88
  it "detects we are a guest" do
89
- [ 'Common KVM processor', 'QEMU Virtual CPU version (cpu64-rhel6) ("GenuineIntel" 686-class)', 'Common 32-bit KVM processor'].each do |kvm_string|
89
+ [ "Common KVM processor", 'QEMU Virtual CPU version (cpu64-rhel6) ("GenuineIntel" 686-class)', "Common 32-bit KVM processor"].each do |kvm_string|
90
90
  allow(@plugin).to receive(:shell_out).with("sysctl -n hw.model").and_return(mock_shell_out(0, kvm_string, ""))
91
91
  @plugin.run
92
92
  expect(@plugin[:virtualization][:system]).to eq("kvm")
@@ -16,9 +16,9 @@
16
16
  # limitations under the License.
17
17
  #
18
18
 
19
- require 'rbconfig'
19
+ require "rbconfig"
20
20
 
21
- require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '/spec_helper.rb'))
21
+ require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
22
22
 
23
23
  C_GCC = <<EOF
24
24
  Reading specs from /usr/lib/gcc/x86_64-redhat-linux/3.4.6/specs
@@ -42,7 +42,7 @@ Available extensions:
42
42
  The C stubs add-on version 2.1.2.
43
43
  BIND-8.2.3-T5B
44
44
  NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
45
- Glibc-2.0 compatibility add-on by Cristian Gafton
45
+ Glibc-2.0 compatibility add-on by Cristian Gafton
46
46
  GNU Libidn by Simon Josefsson
47
47
  libthread_db work sponsored by Alpha Processor Inc
48
48
  Thread-local storage support included.
@@ -59,14 +59,14 @@ PARTICULAR PURPOSE.
59
59
  Compiled by GNU CC version 4.1.2 20080704 (Red Hat 4.1.2-44).
60
60
  Compiled on a Linux 2.6.9 system on 2009-09-02.
61
61
  Available extensions:
62
- The C stubs add-on version 2.1.2.
63
- crypt add-on version 2.1 by Michael Glad and others
64
- GNU Libidn by Simon Josefsson
65
- GNU libio by Per Bothner
66
- NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
67
- Native POSIX Threads Library by Ulrich Drepper et al
68
- BIND-8.2.3-T5B
69
- RT using linux kernel aio
62
+ The C stubs add-on version 2.1.2.
63
+ crypt add-on version 2.1 by Michael Glad and others
64
+ GNU Libidn by Simon Josefsson
65
+ GNU libio by Per Bothner
66
+ NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
67
+ Native POSIX Threads Library by Ulrich Drepper et al
68
+ BIND-8.2.3-T5B
69
+ RT using linux kernel aio
70
70
  Thread-local storage support included.
71
71
  For bug reporting instructions, please see:
72
72
  <http://www.gnu.org/software/libc/bugs.html>.
@@ -97,7 +97,7 @@ C_HPUX = <<EOF
97
97
  $Revision: 92453-07 linker linker crt0.o B.11.47 051104 $
98
98
  LINT B.11.11.16 CXREF B.11.11.16
99
99
  HP92453-01 B.11.11.16 HP C Compiler
100
- $ PATCH/11.00:PHCO_27774 Oct 3 2002 09:45:59 $
100
+ $ PATCH/11.00:PHCO_27774 Oct 3 2002 09:45:59 $
101
101
  EOF
102
102
 
103
103
  describe Ohai::System, "plugin c" do
@@ -19,9 +19,9 @@
19
19
  #
20
20
 
21
21
  begin
22
- require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper.rb')
22
+ require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
23
23
 
24
- require 'chef/version'
24
+ require "chef/version"
25
25
 
26
26
  describe Ohai::System, "plugin chef" do
27
27
  before(:each) do
@@ -15,7 +15,7 @@
15
15
  # limitations under the License.
16
16
  #
17
17
 
18
- require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper.rb')
18
+ require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
19
19
 
20
20
  describe Ohai::System, "plugin cloud" do
21
21
  before(:each) do
@@ -41,15 +41,15 @@ describe Ohai::System, "plugin cloud" do
41
41
  end
42
42
 
43
43
  it "populates cloud public ip" do
44
- @plugin[:ec2]['public_ipv4'] = "174.129.150.8"
44
+ @plugin[:ec2]["public_ipv4"] = "174.129.150.8"
45
45
  @plugin.run
46
- expect(@plugin[:cloud][:public_ips][0]).to eq(@plugin[:ec2]['public_ipv4'])
46
+ expect(@plugin[:cloud][:public_ips][0]).to eq(@plugin[:ec2]["public_ipv4"])
47
47
  end
48
48
 
49
49
  it "populates cloud private ip" do
50
- @plugin[:ec2]['local_ipv4'] = "10.252.42.149"
50
+ @plugin[:ec2]["local_ipv4"] = "10.252.42.149"
51
51
  @plugin.run
52
- expect(@plugin[:cloud][:private_ips][0]).to eq(@plugin[:ec2]['local_ipv4'])
52
+ expect(@plugin[:cloud][:private_ips][0]).to eq(@plugin[:ec2]["local_ipv4"])
53
53
  end
54
54
 
55
55
  it "populates cloud provider" do
@@ -111,19 +111,19 @@ describe Ohai::System, "plugin cloud" do
111
111
  end
112
112
 
113
113
  it "populates cloud public ip" do
114
- @plugin[:linode]['public_ip'] = "174.129.150.8"
114
+ @plugin[:linode]["public_ip"] = "174.129.150.8"
115
115
  @plugin.run
116
116
  expect(@plugin[:cloud][:public_ips][0]).to eq(@plugin[:linode][:public_ip])
117
117
  end
118
118
 
119
119
  it "populates cloud private ip" do
120
- @plugin[:linode]['private_ip'] = "10.252.42.149"
120
+ @plugin[:linode]["private_ip"] = "10.252.42.149"
121
121
  @plugin.run
122
122
  expect(@plugin[:cloud][:private_ips][0]).to eq(@plugin[:linode][:private_ip])
123
123
  end
124
124
 
125
125
  it "populates first cloud public ip" do
126
- @plugin[:linode]['public_ip'] = "174.129.150.8"
126
+ @plugin[:linode]["public_ip"] = "174.129.150.8"
127
127
  @plugin.run
128
128
  expect(@plugin[:cloud][:public_ips].first).to eq(@plugin[:linode][:public_ip])
129
129
  end
@@ -140,15 +140,15 @@ describe Ohai::System, "plugin cloud" do
140
140
  end
141
141
 
142
142
  it "populates cloud public ip" do
143
- @plugin[:eucalyptus]['public_ipv4'] = "174.129.150.8"
143
+ @plugin[:eucalyptus]["public_ipv4"] = "174.129.150.8"
144
144
  @plugin.run
145
- expect(@plugin[:cloud][:public_ips][0]).to eq(@plugin[:eucalyptus]['public_ipv4'])
145
+ expect(@plugin[:cloud][:public_ips][0]).to eq(@plugin[:eucalyptus]["public_ipv4"])
146
146
  end
147
147
 
148
148
  it "populates cloud private ip" do
149
- @plugin[:eucalyptus]['local_ipv4'] = "10.252.42.149"
149
+ @plugin[:eucalyptus]["local_ipv4"] = "10.252.42.149"
150
150
  @plugin.run
151
- expect(@plugin[:cloud][:private_ips][0]).to eq(@plugin[:eucalyptus]['local_ipv4'])
151
+ expect(@plugin[:cloud][:private_ips][0]).to eq(@plugin[:eucalyptus]["local_ipv4"])
152
152
  end
153
153
 
154
154
  it "populates cloud provider" do
@@ -163,41 +163,41 @@ describe Ohai::System, "plugin cloud" do
163
163
  end
164
164
 
165
165
  it "populates cloud public ip" do
166
- @plugin[:azure]['public_ip'] = "174.129.150.8"
166
+ @plugin[:azure]["public_ip"] = "174.129.150.8"
167
167
  @plugin.run
168
- expect(@plugin[:cloud][:public_ips][0]).to eq(@plugin[:azure]['public_ip'])
169
- expect(@plugin[:cloud][:public_ipv4]).to eq(@plugin[:azure]['public_ip'])
168
+ expect(@plugin[:cloud][:public_ips][0]).to eq(@plugin[:azure]["public_ip"])
169
+ expect(@plugin[:cloud][:public_ipv4]).to eq(@plugin[:azure]["public_ip"])
170
170
  end
171
171
 
172
172
  it "populates cloud vm_name" do
173
- @plugin[:azure]['vm_name'] = "linux-vm"
173
+ @plugin[:azure]["vm_name"] = "linux-vm"
174
174
  @plugin.run
175
- expect(@plugin[:cloud][:vm_name]).to eq(@plugin[:azure]['vm_name'])
175
+ expect(@plugin[:cloud][:vm_name]).to eq(@plugin[:azure]["vm_name"])
176
176
  end
177
177
 
178
178
  it "populates cloud public_fqdn" do
179
- @plugin[:azure]['public_fqdn'] = "linux-vm-svc.cloudapp.net"
179
+ @plugin[:azure]["public_fqdn"] = "linux-vm-svc.cloudapp.net"
180
180
  @plugin.run
181
- expect(@plugin[:cloud][:public_fqdn]).to eq(@plugin[:azure]['public_fqdn'])
182
- expect(@plugin[:cloud][:public_hostname]).to eq(@plugin[:azure]['public_fqdn'])
181
+ expect(@plugin[:cloud][:public_fqdn]).to eq(@plugin[:azure]["public_fqdn"])
182
+ expect(@plugin[:cloud][:public_hostname]).to eq(@plugin[:azure]["public_fqdn"])
183
183
  end
184
184
 
185
185
  it "populates cloud public_ssh_port" do
186
- @plugin[:azure]['public_ssh_port'] = "22"
186
+ @plugin[:azure]["public_ssh_port"] = "22"
187
187
  @plugin.run
188
- expect(@plugin[:cloud][:public_ssh_port]).to eq(@plugin[:azure]['public_ssh_port'])
188
+ expect(@plugin[:cloud][:public_ssh_port]).to eq(@plugin[:azure]["public_ssh_port"])
189
189
  end
190
190
 
191
191
  it "should not populate cloud public_ssh_port when winrm is used" do
192
- @plugin[:azure]['public_winrm_port'] = "5985"
192
+ @plugin[:azure]["public_winrm_port"] = "5985"
193
193
  @plugin.run
194
194
  expect(@plugin[:cloud][:public_ssh_port]).to be_nil
195
195
  end
196
196
 
197
197
  it "populates cloud public_winrm_port" do
198
- @plugin[:azure]['public_winrm_port'] = "5985"
198
+ @plugin[:azure]["public_winrm_port"] = "5985"
199
199
  @plugin.run
200
- expect(@plugin[:cloud][:public_winrm_port]).to eq(@plugin[:azure]['public_winrm_port'])
200
+ expect(@plugin[:cloud][:public_winrm_port]).to eq(@plugin[:azure]["public_winrm_port"])
201
201
  end
202
202
 
203
203
  it "populates cloud provider" do
@@ -211,10 +211,10 @@ describe Ohai::System, "plugin cloud" do
211
211
  @plugin[:digital_ocean] = Mash.new
212
212
  @plugin[:digital_ocean][:name] = "public.example.com"
213
213
  @plugin[:digital_ocean][:networks] = Mash.new
214
- @plugin[:digital_ocean][:networks][:v4] = [{"ip_address" => "1.2.3.4", "type" => "public"},
215
- {"ip_address" => "5.6.7.8", "type" => "private"}]
216
- @plugin[:digital_ocean][:networks][:v6] = [{"ip_address" => "fe80::4240:95ff:fe47:6eee", "type" => "public"},
217
- {"ip_address" => "fdf8:f53b:82e4::53", "type" => "private"}]
214
+ @plugin[:digital_ocean][:networks][:v4] = [{ "ip_address" => "1.2.3.4", "type" => "public" },
215
+ { "ip_address" => "5.6.7.8", "type" => "private" }]
216
+ @plugin[:digital_ocean][:networks][:v6] = [{ "ip_address" => "fe80::4240:95ff:fe47:6eee", "type" => "public" },
217
+ { "ip_address" => "fdf8:f53b:82e4::53", "type" => "private" }]
218
218
  end
219
219
 
220
220
  before(:each) do
@@ -230,29 +230,29 @@ describe Ohai::System, "plugin cloud" do
230
230
  end
231
231
 
232
232
  it "populates cloud public ips" do
233
- expect(@plugin[:cloud][:public_ips]).to eq(@plugin[:digital_ocean][:networks][:v4].select{|ip| ip['type'] == 'public'} +
234
- @plugin[:digital_ocean][:networks][:v6].select{|ip| ip['type'] == 'public'})
233
+ expect(@plugin[:cloud][:public_ips]).to eq(@plugin[:digital_ocean][:networks][:v4].select { |ip| ip["type"] == "public" } +
234
+ @plugin[:digital_ocean][:networks][:v6].select { |ip| ip["type"] == "public" })
235
235
  end
236
236
 
237
237
  it "populates cloud private ips" do
238
- expect(@plugin[:cloud][:private_ips]).to eq(@plugin[:digital_ocean][:networks][:v4].select{|ip| ip['type'] == 'private'} +
239
- @plugin[:digital_ocean][:networks][:v6].select{|ip| ip['type'] == 'private'})
238
+ expect(@plugin[:cloud][:private_ips]).to eq(@plugin[:digital_ocean][:networks][:v4].select { |ip| ip["type"] == "private" } +
239
+ @plugin[:digital_ocean][:networks][:v6].select { |ip| ip["type"] == "private" })
240
240
  end
241
241
 
242
242
  it "populates cloud public_ipv4" do
243
- expect(@plugin[:cloud][:public_ipv4]).to eq(@plugin[:digital_ocean][:networks][:v4].find{|ip| ip['type'] == 'public'})
243
+ expect(@plugin[:cloud][:public_ipv4]).to eq(@plugin[:digital_ocean][:networks][:v4].find { |ip| ip["type"] == "public" })
244
244
  end
245
245
 
246
246
  it "populates cloud local_ipv4" do
247
- expect(@plugin[:cloud][:local_ipv4]).to eq(@plugin[:digital_ocean][:networks][:v4].find{|ip| ip['type'] == 'private'})
247
+ expect(@plugin[:cloud][:local_ipv4]).to eq(@plugin[:digital_ocean][:networks][:v4].find { |ip| ip["type"] == "private" })
248
248
  end
249
249
 
250
250
  it "populates cloud public_ipv6" do
251
- expect(@plugin[:cloud][:public_ipv6]).to eq(@plugin[:digital_ocean][:networks][:v6].find{|ip| ip['type'] == 'public'})
251
+ expect(@plugin[:cloud][:public_ipv6]).to eq(@plugin[:digital_ocean][:networks][:v6].find { |ip| ip["type"] == "public" })
252
252
  end
253
253
 
254
254
  it "populates cloud local_ipv6" do
255
- expect(@plugin[:cloud][:local_ipv6]).to eq(@plugin[:digital_ocean][:networks][:v6].find{|ip| ip['type'] == 'private'})
255
+ expect(@plugin[:cloud][:local_ipv6]).to eq(@plugin[:digital_ocean][:networks][:v6].find { |ip| ip["type"] == "private" })
256
256
  end
257
257
 
258
258
  it "populates cloud provider" do
@@ -15,8 +15,8 @@
15
15
  # limitations under the License.
16
16
  #
17
17
 
18
- require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper.rb')
19
- require 'ipaddr'
18
+ require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
19
+ require "ipaddr"
20
20
 
21
21
  describe "CloudAttrs object" do
22
22
  before(:each) do
@@ -24,17 +24,17 @@ describe "CloudAttrs object" do
24
24
  end
25
25
 
26
26
  let(:cloud_node) do
27
- {"public_ipv4_addrs"=>["1.2.3.1"],
28
- "local_ipv4_addrs"=>["1.2.4.1"],
29
- "public_ipv6_addrs"=>["3ffe:505:2::1"],
30
- "local_ipv6_addrs"=>["3ffe:506:2::1"],
31
- "public_ipv4"=>"1.2.3.1",
32
- "local_ipv4"=>"1.2.4.1",
33
- "public_ipv6"=>"3ffe:505:2::1",
34
- "local_ipv6"=>"3ffe:506:2::1",
35
- "public_hostname"=>"myhost.somewhere.com",
36
- "local_hostname"=>"my-localhost",
37
- "provider"=>"my_awesome_cloud"
27
+ { "public_ipv4_addrs" => ["1.2.3.1"],
28
+ "local_ipv4_addrs" => ["1.2.4.1"],
29
+ "public_ipv6_addrs" => ["3ffe:505:2::1"],
30
+ "local_ipv6_addrs" => ["3ffe:506:2::1"],
31
+ "public_ipv4" => "1.2.3.1",
32
+ "local_ipv4" => "1.2.4.1",
33
+ "public_ipv6" => "3ffe:505:2::1",
34
+ "local_ipv6" => "3ffe:506:2::1",
35
+ "public_hostname" => "myhost.somewhere.com",
36
+ "local_hostname" => "my-localhost",
37
+ "provider" => "my_awesome_cloud",
38
38
  }
39
39
  end
40
40
 
@@ -52,17 +52,17 @@ describe "CloudAttrs object" do
52
52
 
53
53
  it "throws exception with a bad ipv4 address" do
54
54
  @cloud_attr_obj = ::CloudAttrs.new()
55
- expect { @cloud_attr_obj.add_ipv6_addr("somebogusstring", :public) }.to raise_error(RuntimeError)
55
+ expect { @cloud_attr_obj.add_ipv6_addr("somebogusstring", :public) }.to raise_error(RuntimeError)
56
56
  end
57
57
 
58
58
  it "throws exception with a bad ipv6 address" do
59
59
  @cloud_attr_obj = ::CloudAttrs.new()
60
- expect { @cloud_attr_obj.add_ipv6_addr("FEED:B0B:DEAD:BEEF", :public) }.to raise_error(RuntimeError)
60
+ expect { @cloud_attr_obj.add_ipv6_addr("FEED:B0B:DEAD:BEEF", :public) }.to raise_error(RuntimeError)
61
61
  end
62
62
 
63
63
  it "throws exception with ipv6 address passed to ipv4" do
64
64
  @cloud_attr_obj = ::CloudAttrs.new()
65
- expect { @cloud_attr_obj.add_ipv4_addr("3ffe:506:2::1", :public) }.to raise_error(RuntimeError)
65
+ expect { @cloud_attr_obj.add_ipv4_addr("3ffe:506:2::1", :public) }.to raise_error(RuntimeError)
66
66
  end
67
67
 
68
68
  it "throws exception with ipv4 address passed to ipv6" do
@@ -70,7 +70,6 @@ describe "CloudAttrs object" do
70
70
  expect { @cloud_attr_obj.add_ipv6_addr("1.2.3.4", :public) }.to raise_error(RuntimeError)
71
71
  end
72
72
 
73
-
74
73
  end
75
74
 
76
75
  describe Ohai::System, "plugin cloud" do
@@ -98,15 +97,15 @@ describe Ohai::System, "plugin cloud" do
98
97
  end
99
98
 
100
99
  it "populates cloud public ip" do
101
- @plugin[:ec2]['public_ipv4'] = "174.129.150.8"
100
+ @plugin[:ec2]["public_ipv4"] = "174.129.150.8"
102
101
  @plugin.run
103
- expect(@plugin[:cloud_v2][:public_ipv4_addrs][0]).to eq(@plugin[:ec2]['public_ipv4'])
102
+ expect(@plugin[:cloud_v2][:public_ipv4_addrs][0]).to eq(@plugin[:ec2]["public_ipv4"])
104
103
  end
105
104
 
106
105
  it "populates cloud private ip" do
107
- @plugin[:ec2]['local_ipv4'] = "10.252.42.149"
106
+ @plugin[:ec2]["local_ipv4"] = "10.252.42.149"
108
107
  @plugin.run
109
- expect(@plugin[:cloud_v2][:local_ipv4_addrs][0]).to eq(@plugin[:ec2]['local_ipv4'])
108
+ expect(@plugin[:cloud_v2][:local_ipv4_addrs][0]).to eq(@plugin[:ec2]["local_ipv4"])
110
109
  end
111
110
 
112
111
  it "populates cloud provider" do
@@ -119,13 +118,13 @@ describe Ohai::System, "plugin cloud" do
119
118
  describe "with a public IP" do
120
119
  before do
121
120
  @plugin[:gce] = Mash.new()
122
- @plugin[:gce]['instance'] = Mash.new()
123
- @plugin[:gce]['instance']['networkInterfaces'] = [
121
+ @plugin[:gce]["instance"] = Mash.new()
122
+ @plugin[:gce]["instance"]["networkInterfaces"] = [
124
123
  {
125
- "accessConfigs" => [ {"externalIp" => "8.35.198.173", "type"=>"ONE_TO_ONE_NAT"} ],
124
+ "accessConfigs" => [ { "externalIp" => "8.35.198.173", "type" => "ONE_TO_ONE_NAT" } ],
126
125
  "ip" => "10.240.0.102",
127
- "network"=> "projects/foo/networks/default"
128
- }
126
+ "network" => "projects/foo/networks/default",
127
+ },
129
128
  ]
130
129
  end
131
130
 
@@ -148,13 +147,13 @@ describe Ohai::System, "plugin cloud" do
148
147
  describe "with no public IP" do
149
148
  before do
150
149
  @plugin[:gce] = Mash.new()
151
- @plugin[:gce]['instance'] = Mash.new()
152
- @plugin[:gce]['instance']['networkInterfaces'] = [
150
+ @plugin[:gce]["instance"] = Mash.new()
151
+ @plugin[:gce]["instance"]["networkInterfaces"] = [
153
152
  {
154
- "accessConfigs" => [ {"externalIp" => "", "type" => "ONE_TO_ONE_NAT"} ],
153
+ "accessConfigs" => [ { "externalIp" => "", "type" => "ONE_TO_ONE_NAT" } ],
155
154
  "ip" => "10.240.0.102",
156
- "network" => "projects/foo/networks/default"
157
- }
155
+ "network" => "projects/foo/networks/default",
156
+ },
158
157
  ]
159
158
  end
160
159
 
@@ -228,19 +227,19 @@ describe Ohai::System, "plugin cloud" do
228
227
  end
229
228
 
230
229
  it "populates cloud public ip" do
231
- @plugin[:linode]['public_ip'] = "174.129.150.8"
230
+ @plugin[:linode]["public_ip"] = "174.129.150.8"
232
231
  @plugin.run
233
232
  expect(@plugin[:cloud_v2][:public_ipv4_addrs][0]).to eq(@plugin[:linode][:public_ip])
234
233
  end
235
234
 
236
235
  it "populates cloud private ip" do
237
- @plugin[:linode]['private_ip'] = "10.252.42.149"
236
+ @plugin[:linode]["private_ip"] = "10.252.42.149"
238
237
  @plugin.run
239
238
  expect(@plugin[:cloud_v2][:local_ipv4_addrs][0]).to eq(@plugin[:linode][:private_ip])
240
239
  end
241
240
 
242
241
  it "populates first cloud public ip" do
243
- @plugin[:linode]['public_ip'] = "174.129.150.8"
242
+ @plugin[:linode]["public_ip"] = "174.129.150.8"
244
243
  @plugin.run
245
244
  expect(@plugin[:cloud_v2][:public_ipv4_addrs].first).to eq(@plugin[:linode][:public_ip])
246
245
  end
@@ -257,15 +256,15 @@ describe Ohai::System, "plugin cloud" do
257
256
  end
258
257
 
259
258
  it "populates cloud public ip" do
260
- @plugin[:eucalyptus]['public_ipv4'] = "174.129.150.8"
259
+ @plugin[:eucalyptus]["public_ipv4"] = "174.129.150.8"
261
260
  @plugin.run
262
- expect(@plugin[:cloud_v2][:public_ipv4_addrs][0]).to eq(@plugin[:eucalyptus]['public_ipv4'])
261
+ expect(@plugin[:cloud_v2][:public_ipv4_addrs][0]).to eq(@plugin[:eucalyptus]["public_ipv4"])
263
262
  end
264
263
 
265
264
  it "populates cloud private ip" do
266
- @plugin[:eucalyptus]['local_ipv4'] = "10.252.42.149"
265
+ @plugin[:eucalyptus]["local_ipv4"] = "10.252.42.149"
267
266
  @plugin.run
268
- expect(@plugin[:cloud_v2][:local_ipv4_addrs][0]).to eq(@plugin[:eucalyptus]['local_ipv4'])
267
+ expect(@plugin[:cloud_v2][:local_ipv4_addrs][0]).to eq(@plugin[:eucalyptus]["local_ipv4"])
269
268
  end
270
269
 
271
270
  it "populates cloud provider" do
@@ -280,37 +279,37 @@ describe Ohai::System, "plugin cloud" do
280
279
  end
281
280
 
282
281
  it "populates cloud public ip" do
283
- @plugin[:azure]['public_ip'] = "174.129.150.8"
282
+ @plugin[:azure]["public_ip"] = "174.129.150.8"
284
283
  @plugin.run
285
- expect(@plugin[:cloud_v2][:public_ipv4_addrs][0]).to eq(@plugin[:azure]['public_ip'])
284
+ expect(@plugin[:cloud_v2][:public_ipv4_addrs][0]).to eq(@plugin[:azure]["public_ip"])
286
285
  end
287
286
 
288
287
  it "doesn't populates cloud vm_name" do
289
- @plugin[:azure]['vm_name'] = "linux-vm"
288
+ @plugin[:azure]["vm_name"] = "linux-vm"
290
289
  @plugin.run
291
- expect(@plugin[:cloud_v2][:vm_name]).not_to eq(@plugin[:azure]['vm_name'])
290
+ expect(@plugin[:cloud_v2][:vm_name]).not_to eq(@plugin[:azure]["vm_name"])
292
291
  end
293
292
 
294
293
  it "populates cloud public_hostname" do
295
- @plugin[:azure]['public_fqdn'] = "linux-vm-svc.cloudapp.net"
294
+ @plugin[:azure]["public_fqdn"] = "linux-vm-svc.cloudapp.net"
296
295
  @plugin.run
297
- expect(@plugin[:cloud_v2][:public_hostname]).to eq(@plugin[:azure]['public_fqdn'])
296
+ expect(@plugin[:cloud_v2][:public_hostname]).to eq(@plugin[:azure]["public_fqdn"])
298
297
  end
299
298
 
300
299
  it "doesn't populate cloud public_ssh_port" do
301
- @plugin[:azure]['public_ssh_port'] = "22"
300
+ @plugin[:azure]["public_ssh_port"] = "22"
302
301
  @plugin.run
303
302
  expect(@plugin[:cloud_v2][:public_ssh_port]).to be_nil
304
303
  end
305
304
 
306
305
  it "should not populate cloud public_ssh_port when winrm is used" do
307
- @plugin[:azure]['public_winrm_port'] = "5985"
306
+ @plugin[:azure]["public_winrm_port"] = "5985"
308
307
  @plugin.run
309
308
  expect(@plugin[:cloud_v2][:public_ssh_port]).to be_nil
310
309
  end
311
310
 
312
311
  it "populates cloud public_winrm_port" do
313
- @plugin[:azure]['public_winrm_port'] = "5985"
312
+ @plugin[:azure]["public_winrm_port"] = "5985"
314
313
  @plugin.run
315
314
  expect(@plugin[:cloud_v2][:public_winrm_port]).to be_nil
316
315
  end
@@ -326,10 +325,10 @@ describe Ohai::System, "plugin cloud" do
326
325
  @plugin[:digital_ocean] = Mash.new
327
326
  @plugin[:digital_ocean][:name] = "public.example.com"
328
327
  @plugin[:digital_ocean][:networks] = Mash.new
329
- @plugin[:digital_ocean][:networks][:v4] = [{"ip_address" => "1.2.3.4", "type" => "public"},
330
- {"ip_address" => "5.6.7.8", "type" => "private"}]
331
- @plugin[:digital_ocean][:networks][:v6] = [{"ip_address" => "fe80::4240:95ff:fe47:6eee", "type" => "public"},
332
- {"ip_address" => "fdf8:f53b:82e4::53", "type" => "private"}]
328
+ @plugin[:digital_ocean][:networks][:v4] = [{ "ip_address" => "1.2.3.4", "type" => "public" },
329
+ { "ip_address" => "5.6.7.8", "type" => "private" }]
330
+ @plugin[:digital_ocean][:networks][:v6] = [{ "ip_address" => "fe80::4240:95ff:fe47:6eee", "type" => "public" },
331
+ { "ip_address" => "fdf8:f53b:82e4::53", "type" => "private" }]
333
332
  end
334
333
 
335
334
  before(:each) do
@@ -345,41 +344,41 @@ describe Ohai::System, "plugin cloud" do
345
344
  end
346
345
 
347
346
  it "populates cloud public_ipv4_addrs" do
348
- expect(@plugin[:cloud_v2][:public_ipv4_addrs]).to eq(@plugin[:digital_ocean][:networks][:v4].select{|ip| ip['type'] == 'public'}
349
- .map{|ip| ip['ip_address']})
350
-
347
+ expect(@plugin[:cloud_v2][:public_ipv4_addrs]).to eq(@plugin[:digital_ocean][:networks][:v4].select { |ip| ip["type"] == "public" }
348
+ .map { |ip| ip["ip_address"] })
349
+
351
350
  end
352
351
 
353
352
  it "populates cloud local_ipv4_addrs" do
354
- expect(@plugin[:cloud_v2][:local_ipv4_addrs]).to eq(@plugin[:digital_ocean][:networks][:v4].select{|ip| ip['type'] == 'private'}
355
- .map{|ip| ip['ip_address']})
356
-
353
+ expect(@plugin[:cloud_v2][:local_ipv4_addrs]).to eq(@plugin[:digital_ocean][:networks][:v4].select { |ip| ip["type"] == "private" }
354
+ .map { |ip| ip["ip_address"] })
355
+
357
356
  end
358
357
 
359
358
  it "populates cloud public_ipv4" do
360
- expect(@plugin[:cloud_v2][:public_ipv4]).to eq(@plugin[:digital_ocean][:networks][:v4].find{|ip| ip['type'] == 'public'}['ip_address'])
359
+ expect(@plugin[:cloud_v2][:public_ipv4]).to eq(@plugin[:digital_ocean][:networks][:v4].find { |ip| ip["type"] == "public" }["ip_address"])
361
360
  end
362
361
 
363
362
  it "populates cloud local_ipv4" do
364
- expect(@plugin[:cloud_v2][:local_ipv4]).to eq(@plugin[:digital_ocean][:networks][:v4].find{|ip| ip['type'] == 'private'}['ip_address'])
363
+ expect(@plugin[:cloud_v2][:local_ipv4]).to eq(@plugin[:digital_ocean][:networks][:v4].find { |ip| ip["type"] == "private" }["ip_address"])
365
364
  end
366
365
 
367
366
  it "populates cloud public_ipv6_addrs" do
368
- expect(@plugin[:cloud_v2][:public_ipv6_addrs]).to eq(@plugin[:digital_ocean][:networks][:v6].select{|ip| ip['type'] == 'public'}
369
- .map{|ip| ip['ip_address']})
367
+ expect(@plugin[:cloud_v2][:public_ipv6_addrs]).to eq(@plugin[:digital_ocean][:networks][:v6].select { |ip| ip["type"] == "public" }
368
+ .map { |ip| ip["ip_address"] })
370
369
  end
371
370
 
372
371
  it "populates cloud local_ipv6_addrs" do
373
- expect(@plugin[:cloud_v2][:local_ipv6_addrs]).to eq(@plugin[:digital_ocean][:networks][:v6].select{|ip| ip['type'] == 'private'}
374
- .map{|ip| ip['ip_address']})
372
+ expect(@plugin[:cloud_v2][:local_ipv6_addrs]).to eq(@plugin[:digital_ocean][:networks][:v6].select { |ip| ip["type"] == "private" }
373
+ .map { |ip| ip["ip_address"] })
375
374
  end
376
375
 
377
376
  it "populates cloud public_ipv6" do
378
- expect(@plugin[:cloud_v2][:public_ipv6]).to eq(@plugin[:digital_ocean][:networks][:v6].find{|ip| ip['type'] == 'public'}['ip_address'])
377
+ expect(@plugin[:cloud_v2][:public_ipv6]).to eq(@plugin[:digital_ocean][:networks][:v6].find { |ip| ip["type"] == "public" }["ip_address"])
379
378
  end
380
379
 
381
380
  it "populates cloud local_ipv6" do
382
- expect(@plugin[:cloud_v2][:local_ipv6]).to eq(@plugin[:digital_ocean][:networks][:v6].find{|ip| ip['type'] == 'private'}['ip_address'])
381
+ expect(@plugin[:cloud_v2][:local_ipv6]).to eq(@plugin[:digital_ocean][:networks][:v6].find { |ip| ip["type"] == "private" }["ip_address"])
383
382
  end
384
383
 
385
384
  it "populates cloud provider" do