vcenter_lib 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2376ecb47d79ea967c886252fc7ed379cebf9316
4
- data.tar.gz: 1fbfc80536138813480ce2fcc755702db768af36
3
+ metadata.gz: 597f40cdd4aa4d32ff8f652aa59770487dc61e62
4
+ data.tar.gz: 785a449ace683855af51cf36479c9b073cd79530
5
5
  SHA512:
6
- metadata.gz: f4d74f9f8ea4bea63040cc91ace53585b2d87ce34613485c99a63399bdbbbc0adf935db86601f4aacbc8a2c7bb1d34d3d731163f70cd210576f7626b5a2b4ae7
7
- data.tar.gz: 3474b8371d6667c03188e705e4f7f6c1d9fa61f5675facb12664b2c13d3d0e8c1f36f616a64a3eeeb36008ef33595b6fa29e0c5e294ff5451cc0521f9150ca58
6
+ metadata.gz: e96991bfcdadad96c2a1b22a89060e8417ec19f403e5470b02eeaca4f7da5aa0093ec36c7ae05595e6e3c5c742a6758ac6936f9213d586ce0aa2e83a75ba4dfe
7
+ data.tar.gz: e3bf7fe9e55bc2a65743b9e674c1b52eccbd0ff8dad2830bb0a825e43125bab3eb1508ef26fc4d192bd431665e782e719713e405616e59264c0064c284f692b7
data/.rubocop.yml CHANGED
@@ -63,7 +63,7 @@ Style/GlobalVars:
63
63
  Style/RegexpLiteral:
64
64
  Enabled: true
65
65
 
66
- Style/AlignParameters:
66
+ Layout/AlignParameters:
67
67
  EnforcedStyle: "with_fixed_indentation"
68
68
 
69
69
  Style/BracesAroundHashParameters:
@@ -19,13 +19,16 @@ module VcenterLib
19
19
 
20
20
  # get all vms in all datacenters
21
21
  def vms
22
- dcs.inject([]) do |result, dc|
23
- result + serviceContent.viewManager.CreateContainerView(
22
+ logger.debug "get all VMs in all datacenters: begin"
23
+ result = dcs.inject([]) do |r, dc|
24
+ r + serviceContent.viewManager.CreateContainerView(
24
25
  container: dc.vmFolder,
25
26
  type: ['VirtualMachine'],
26
27
  recursive: true
27
28
  ).view
28
29
  end
30
+ logger.debug "get all VMs in all datacenters: end"
31
+ result
29
32
  end
30
33
 
31
34
  # find vm
@@ -1,3 +1,3 @@
1
1
  module VcenterLib
2
- VERSION = '0.0.2'.freeze
2
+ VERSION = '0.0.3'.freeze
3
3
  end
@@ -50,11 +50,14 @@ module VcenterLib
50
50
  @vcenter = vcenter
51
51
  end
52
52
 
53
- # get all vms and their facts
53
+ # get all vms and their facts as hash with vm.name as key
54
54
  def facts
55
- vm_mos_to_h(@vcenter.vms).map do |h|
56
- [h['name'], h]
57
- end
55
+ logger.debug "get complete data of all VMs in all datacenters: begin"
56
+ result = Hash[vm_mos_to_h(@vcenter.vms).map do |h|
57
+ [h['name'], Hash[h.map { |k, v| [k.tr('.', '_'), v] }]]
58
+ end]
59
+ logger.debug "get complete data of all VMs in all datacenters: end"
60
+ result
58
61
  end
59
62
 
60
63
  # convert a VMware RbVmomi::VIM::ManagedObject into a simple hash.
@@ -79,6 +82,7 @@ module VcenterLib
79
82
  # rubocop:enable Style/RescueModifier
80
83
  hosts[v] = extra
81
84
  end
85
+ true
82
86
  end
83
87
  end
84
88
  props.merge!(extra)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vcenter_lib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Meyling
@@ -139,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
139
  version: '0'
140
140
  requirements: []
141
141
  rubyforge_project:
142
- rubygems_version: 2.5.1
142
+ rubygems_version: 2.6.8
143
143
  signing_key:
144
144
  specification_version: 4
145
145
  summary: easy access to vcenter informations