fog-vsphere 3.5.0 → 3.6.0

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
  SHA256:
3
- metadata.gz: 18ada3fe97234aa0bf59aaab14ea04ba2ceaa40cb62abc6189026b6214d85759
4
- data.tar.gz: 7894e6c462e8501eb2c9a16170300d75516ba8e4431a64be14d5cc6140271fbe
3
+ metadata.gz: 894200caa04d87aa819573c86239ebc6f9f6050ff58f6bd8243f2cdb2ba3de62
4
+ data.tar.gz: 268630c771bab27449b795987b4368911b5531396ece00817bcab4a19845d162
5
5
  SHA512:
6
- metadata.gz: 8db1f07c4c800261506a22d0be60cc2c777a2da9e6001cee6a39a22218719af8eb4f105071383732c40f20201818645954a388420f7291bd0d3fecee0adc1a91
7
- data.tar.gz: ba9313ddc1af94248d965ae9cda4734766cf36c494f33f5f84fc40581be22532ff96700539f63dce3583d955a60e86b75e367795bd3c0ca29291fa921717d1db
6
+ metadata.gz: c04c8a90cda3331a694eddbe9d4d9e6d0942b47ddf4a824808295fd904dc68b3bed3830a10fde6120ad681a3a8c8534970a1133eee209fd713f5d0b5a1b67994
7
+ data.tar.gz: 1d18e55c8326a30f9e2c52ddbff9a87d1f90242b959a8e7eea1b86270134901217b5c61d40890e71cd9f5edcb1ced2c79f9464254453a2536c5b7c490f409af8
@@ -0,0 +1,42 @@
1
+ name: Ruby
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ rubocop:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v3
14
+ - name: Set up Ruby
15
+ uses: ruby/setup-ruby@v1
16
+ with:
17
+ ruby-version: '3.1'
18
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
19
+ - name: Run Rubocop
20
+ run: bundle exec rubocop --format github
21
+
22
+ test:
23
+ runs-on: ubuntu-latest
24
+ needs: rubocop
25
+ strategy:
26
+ matrix:
27
+ ruby-version:
28
+ - '2.7'
29
+ - '3.0'
30
+ - '3.1'
31
+ - 'head'
32
+ continue-on-error: ${{ matrix.ruby-version == 'head' }}
33
+
34
+ steps:
35
+ - uses: actions/checkout@v3
36
+ - name: Set up Ruby
37
+ uses: ruby/setup-ruby@v1
38
+ with:
39
+ ruby-version: ${{ matrix.ruby-version }}
40
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
41
+ - name: Run tests
42
+ run: bundle exec rake test
data/.rubocop.yml CHANGED
@@ -1,13 +1,19 @@
1
1
  inherit_from:
2
2
  - .rubocop_todo.yml
3
3
 
4
+ require:
5
+ - rubocop-minitest
6
+ - rubocop-performance
7
+ - rubocop-rake
8
+
4
9
  AllCops:
5
- TargetRubyVersion: 2.0
10
+ TargetRubyVersion: 2.7
11
+ NewCops: enable
6
12
 
7
13
  Style/Documentation:
8
14
  Enabled: false
9
15
 
10
- HashSyntax:
16
+ Style/HashSyntax:
11
17
  Enabled: false # don't force 1.9 hash syntax
12
18
 
13
19
  Style/StringLiterals:
@@ -31,9 +37,6 @@ Metrics/CyclomaticComplexity:
31
37
  Metrics/PerceivedComplexity:
32
38
  Enabled: false
33
39
 
34
- Performance/Casecmp:
35
- Enabled: false
36
-
37
40
  Style/RescueModifier:
38
41
  Enabled: false
39
42
 
data/.rubocop_todo.yml CHANGED
@@ -1,23 +1,62 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2018-11-15 11:16:00 -0500 using RuboCop version 0.49.1.
3
+ # on 2022-11-18 13:06:52 UTC using RuboCop version 1.39.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 4
10
- # Configuration parameters: AllowSafeAssignment.
11
- Lint/AssignmentInCondition:
9
+ # Offense count: 1
10
+ # This cop supports safe autocorrection (--autocorrect).
11
+ # Configuration parameters: Include.
12
+ # Include: **/*.gemspec
13
+ Gemspec/DeprecatedAttributeAssignment:
12
14
  Exclude:
13
- - 'lib/fog/vsphere/requests/compute/create_vm.rb'
14
- - 'lib/fog/vsphere/requests/compute/vm_clone.rb'
15
+ - 'fog-vsphere.gemspec'
16
+
17
+ # Offense count: 3
18
+ # This cop supports safe autocorrection (--autocorrect).
19
+ # Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include.
20
+ # Include: **/*.gemspec
21
+ Gemspec/OrderedDependencies:
22
+ Exclude:
23
+ - 'fog-vsphere.gemspec'
24
+
25
+ # Offense count: 1
26
+ # This cop supports safe autocorrection (--autocorrect).
27
+ # Configuration parameters: Include.
28
+ # Include: **/*.gemspec
29
+ Gemspec/RequireMFA:
30
+ Exclude:
31
+ - 'fog-vsphere.gemspec'
32
+
33
+ # Offense count: 12
34
+ # This cop supports safe autocorrection (--autocorrect).
35
+ # Configuration parameters: EnforcedStyleAlignWith, Severity.
36
+ # SupportedStylesAlignWith: start_of_line, begin
37
+ Layout/BeginEndAlignment:
38
+ Exclude:
39
+ - 'lib/fog/vsphere/compute.rb'
40
+ - 'lib/fog/vsphere/requests/compute/list_hosts.rb'
41
+ - 'lib/fog/vsphere/requests/compute/list_vm_cdroms.rb'
42
+ - 'lib/fog/vsphere/requests/compute/list_vm_volumes.rb'
43
+
44
+ # Offense count: 105
45
+ # This cop supports safe autocorrection (--autocorrect).
46
+ Layout/EmptyLineAfterGuardClause:
47
+ Enabled: false
48
+
49
+ # Offense count: 22
50
+ # This cop supports safe autocorrection (--autocorrect).
51
+ # Configuration parameters: EmptyLineBetweenMethodDefs, EmptyLineBetweenClassDefs, EmptyLineBetweenModuleDefs, AllowAdjacentOneLineDefs, NumberOfEmptyLines.
52
+ Layout/EmptyLineBetweenDefs:
53
+ Enabled: false
15
54
 
16
55
  # Offense count: 7
17
- # Cop supports --auto-correct.
18
- # Configuration parameters: EnforcedStyleAlignWith, SupportedStylesAlignWith, AutoCorrect.
56
+ # This cop supports safe autocorrection (--autocorrect).
57
+ # Configuration parameters: EnforcedStyleAlignWith, Severity.
19
58
  # SupportedStylesAlignWith: keyword, variable, start_of_line
20
- Lint/EndAlignment:
59
+ Layout/EndAlignment:
21
60
  Exclude:
22
61
  - 'lib/fog/vsphere/models/compute/customfields.rb'
23
62
  - 'lib/fog/vsphere/models/compute/customvalues.rb'
@@ -26,6 +65,107 @@ Lint/EndAlignment:
26
65
  - 'lib/fog/vsphere/requests/compute/create_vm.rb'
27
66
  - 'lib/fog/vsphere/requests/compute/host_start_maintenance.rb'
28
67
 
68
+ # Offense count: 137
69
+ # This cop supports safe autocorrection (--autocorrect).
70
+ # Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
71
+ # SupportedHashRocketStyles: key, separator, table
72
+ # SupportedColonStyles: key, separator, table
73
+ # SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
74
+ Layout/HashAlignment:
75
+ Exclude:
76
+ - 'lib/fog/vsphere/compute.rb'
77
+ - 'lib/fog/vsphere/requests/compute/create_folder.rb'
78
+ - 'lib/fog/vsphere/requests/compute/create_vm.rb'
79
+ - 'lib/fog/vsphere/requests/compute/list_child_snapshots.rb'
80
+ - 'lib/fog/vsphere/requests/compute/list_hosts.rb'
81
+ - 'lib/fog/vsphere/requests/compute/vm_clone.rb'
82
+ - 'lib/fog/vsphere/requests/compute/vm_power_off.rb'
83
+ - 'lib/fog/vsphere/requests/compute/vm_suspend.rb'
84
+
85
+ # Offense count: 2
86
+ # This cop supports safe autocorrection (--autocorrect).
87
+ Layout/LeadingEmptyLines:
88
+ Exclude:
89
+ - 'fog-vsphere.gemspec'
90
+ - 'lib/fog/vsphere/requests/compute/get_vm_first_scsi_controller.rb'
91
+
92
+ # Offense count: 12
93
+ # This cop supports safe autocorrection (--autocorrect).
94
+ Layout/RescueEnsureAlignment:
95
+ Exclude:
96
+ - 'lib/fog/vsphere/compute.rb'
97
+ - 'lib/fog/vsphere/requests/compute/list_hosts.rb'
98
+ - 'lib/fog/vsphere/requests/compute/list_vm_cdroms.rb'
99
+ - 'lib/fog/vsphere/requests/compute/list_vm_volumes.rb'
100
+
101
+ # Offense count: 2
102
+ # This cop supports safe autocorrection (--autocorrect).
103
+ # Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator.
104
+ # SupportedStylesForExponentOperator: space, no_space
105
+ Layout/SpaceAroundOperators:
106
+ Exclude:
107
+ - 'lib/fog/vsphere/compute.rb'
108
+ - 'lib/fog/vsphere/requests/compute/vm_clone.rb'
109
+
110
+ # Offense count: 2
111
+ # Configuration parameters: AllowSafeAssignment.
112
+ Lint/AssignmentInCondition:
113
+ Exclude:
114
+ - 'lib/fog/vsphere/requests/compute/create_vm.rb'
115
+ - 'lib/fog/vsphere/requests/compute/vm_clone.rb'
116
+
117
+ # Offense count: 1
118
+ # Configuration parameters: AllowedMethods.
119
+ # AllowedMethods: enums
120
+ Lint/ConstantDefinitionInBlock:
121
+ Exclude:
122
+ - 'tests/compute_tests.rb'
123
+
124
+ # Offense count: 1
125
+ # Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches.
126
+ Lint/DuplicateBranch:
127
+ Exclude:
128
+ - 'lib/fog/vsphere/requests/compute/create_vm.rb'
129
+
130
+ # Offense count: 1
131
+ # Configuration parameters: AllowComments.
132
+ Lint/EmptyClass:
133
+ Exclude:
134
+ - 'tests/class_from_string_tests.rb'
135
+
136
+ # Offense count: 7
137
+ # Configuration parameters: MaximumRangeSize.
138
+ Lint/MissingCopEnableDirective:
139
+ Exclude:
140
+ - 'lib/fog/vsphere/compute.rb'
141
+ - 'lib/fog/vsphere/requests/compute/create_vm.rb'
142
+ - 'lib/fog/vsphere/requests/compute/list_hosts.rb'
143
+ - 'lib/fog/vsphere/requests/compute/list_vm_cdroms.rb'
144
+ - 'lib/fog/vsphere/requests/compute/list_vm_volumes.rb'
145
+ - 'tests/compute_tests.rb'
146
+
147
+ # Offense count: 4
148
+ # This cop supports safe autocorrection (--autocorrect).
149
+ Lint/RedundantCopDisableDirective:
150
+ Exclude:
151
+ - 'lib/fog/vsphere/compute.rb'
152
+ - 'lib/fog/vsphere/requests/compute/list_hosts.rb'
153
+ - 'lib/fog/vsphere/requests/compute/list_vm_cdroms.rb'
154
+ - 'lib/fog/vsphere/requests/compute/list_vm_volumes.rb'
155
+
156
+ # Offense count: 1
157
+ # This cop supports safe autocorrection (--autocorrect).
158
+ Lint/RedundantCopEnableDirective:
159
+ Exclude:
160
+ - 'lib/fog/vsphere/requests/compute/list_vm_interfaces.rb'
161
+
162
+ # Offense count: 2
163
+ # This cop supports safe autocorrection (--autocorrect).
164
+ Lint/SendWithMixinArgument:
165
+ Exclude:
166
+ - 'tests/helper.rb'
167
+ - 'tests/test_helper.rb'
168
+
29
169
  # Offense count: 3
30
170
  Lint/ShadowingOuterLocalVariable:
31
171
  Exclude:
@@ -33,7 +173,7 @@ Lint/ShadowingOuterLocalVariable:
33
173
  - 'lib/fog/vsphere/requests/compute/destroy_rule.rb'
34
174
  - 'lib/fog/vsphere/requests/compute/get_vm_first_scsi_controller.rb'
35
175
 
36
- # Offense count: 9
176
+ # Offense count: 8
37
177
  Lint/UselessAssignment:
38
178
  Exclude:
39
179
  - 'lib/fog/vsphere/compute.rb'
@@ -42,16 +182,12 @@ Lint/UselessAssignment:
42
182
  - 'lib/fog/vsphere/requests/compute/create_rule.rb'
43
183
  - 'lib/fog/vsphere/requests/compute/create_vm.rb'
44
184
  - 'lib/fog/vsphere/requests/compute/get_interface_type.rb'
45
- - 'lib/fog/vsphere/requests/compute/vm_clone.rb'
46
185
  - 'lib/fog/vsphere/requests/compute/vm_migrate.rb'
47
186
  - 'tests/requests/compute/vm_clone_tests.rb'
48
187
 
49
- # Offense count: 64
50
- Metrics/AbcSize:
51
- Max: 635
52
-
53
188
  # Offense count: 12
54
- # Configuration parameters: CountComments, ExcludedMethods.
189
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, AllowedMethods, AllowedPatterns, IgnoredMethods.
190
+ # AllowedMethods: refine
55
191
  Metrics/BlockLength:
56
192
  Max: 264
57
193
 
@@ -61,44 +197,144 @@ Metrics/BlockNesting:
61
197
  Max: 5
62
198
 
63
199
  # Offense count: 6
64
- # Configuration parameters: CountComments.
200
+ # Configuration parameters: CountComments, CountAsOne.
65
201
  Metrics/ClassLength:
66
202
  Max: 284
67
203
 
68
- # Offense count: 19
69
- Metrics/CyclomaticComplexity:
70
- Max: 151
204
+ # Offense count: 1
205
+ # Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
206
+ Metrics/ParameterLists:
207
+ Max: 6
71
208
 
72
- # Offense count: 819
73
- # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
74
- # URISchemes: http, https
75
- Metrics/LineLength:
76
- Max: 317
209
+ # Offense count: 2
210
+ # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
211
+ Naming/BlockParameterName:
212
+ Exclude:
213
+ - 'lib/fog/vsphere/requests/compute/list_datacenters.rb'
214
+ - 'lib/fog/vsphere/requests/compute/list_resource_pools.rb'
215
+
216
+ # Offense count: 1
217
+ # Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, CheckDefinitionPathHierarchyRoots, Regex, IgnoreExecutableScripts, AllowedAcronyms.
218
+ # CheckDefinitionPathHierarchyRoots: lib, spec, test, src
219
+ # AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
220
+ Naming/FileName:
221
+ Exclude:
222
+ - 'lib/fog-vsphere.rb'
77
223
 
78
- # Offense count: 80
79
- # Configuration parameters: CountComments.
80
- Metrics/MethodLength:
81
- Max: 358
224
+ # Offense count: 1
225
+ # Configuration parameters: EnforcedStyleForLeadingUnderscores.
226
+ # SupportedStylesForLeadingUnderscores: disallowed, required, optional
227
+ Naming/MemoizedInstanceVariableName:
228
+ Exclude:
229
+ - 'tests/test_helper.rb'
230
+
231
+ # Offense count: 11
232
+ # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
233
+ # AllowedNames: as, at, by, db, id, if, in, io, ip, of, on, os, pp, to
234
+ Naming/MethodParameterName:
235
+ Exclude:
236
+ - 'lib/fog/vsphere/compute.rb'
237
+ - 'lib/fog/vsphere/models/compute/volume.rb'
238
+ - 'lib/fog/vsphere/requests/compute/create_vm.rb'
239
+ - 'lib/fog/vsphere/requests/compute/get_virtual_machine.rb'
240
+ - 'lib/fog/vsphere/requests/compute/list_datacenters.rb'
241
+ - 'lib/fog/vsphere/requests/compute/list_resource_pools.rb'
242
+ - 'lib/fog/vsphere/requests/compute/vm_suspend.rb'
243
+ - 'tests/compute_tests.rb'
82
244
 
83
245
  # Offense count: 1
84
- # Configuration parameters: CountComments.
85
- Metrics/ModuleLength:
86
- Max: 109
246
+ # Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros.
247
+ # NamePrefix: is_, has_, have_
248
+ # ForbiddenPrefixes: is_, has_, have_
249
+ # AllowedMethods: is_a?
250
+ # MethodDefinitionMacros: define_method, define_singleton_method
251
+ Naming/PredicateName:
252
+ Exclude:
253
+ - 'spec/**/*'
254
+ - 'lib/fog/vsphere/compute.rb'
255
+
256
+ # Offense count: 41
257
+ # Configuration parameters: EnforcedStyle, AllowedIdentifiers, AllowedPatterns.
258
+ # SupportedStyles: snake_case, camelCase
259
+ Naming/VariableName:
260
+ Exclude:
261
+ - 'lib/fog/vsphere/requests/compute/create_vm.rb'
262
+ - 'lib/fog/vsphere/requests/compute/list_datacenters.rb'
263
+ - 'lib/fog/vsphere/requests/compute/list_resource_pools.rb'
264
+ - 'lib/fog/vsphere/requests/compute/list_server_types.rb'
265
+ - 'lib/fog/vsphere/requests/compute/vm_clone.rb'
266
+
267
+ # Offense count: 3
268
+ # Configuration parameters: MinSize.
269
+ Performance/CollectionLiteralInLoop:
270
+ Exclude:
271
+ - 'lib/fog/vsphere/requests/compute/vm_clone.rb'
87
272
 
88
273
  # Offense count: 2
89
- # Configuration parameters: CountKeywordArgs.
90
- Metrics/ParameterLists:
91
- Max: 6
274
+ # This cop supports unsafe autocorrection (--autocorrect-all).
275
+ Performance/Detect:
276
+ Exclude:
277
+ - 'lib/fog/vsphere/requests/compute/get_server_type.rb'
278
+ - 'lib/fog/vsphere/requests/compute/get_vm_first_scsi_controller.rb'
92
279
 
93
- # Offense count: 20
94
- Metrics/PerceivedComplexity:
95
- Max: 159
280
+ # Offense count: 10
281
+ # This cop supports unsafe autocorrection (--autocorrect-all).
282
+ Performance/MapCompact:
283
+ Exclude:
284
+ - 'lib/fog/vsphere/compute.rb'
285
+ - 'lib/fog/vsphere/requests/compute/get_virtual_machine.rb'
286
+ - 'lib/fog/vsphere/requests/compute/list_clusters.rb'
287
+ - 'lib/fog/vsphere/requests/compute/list_compute_resources.rb'
288
+ - 'lib/fog/vsphere/requests/compute/list_datastores.rb'
289
+ - 'lib/fog/vsphere/requests/compute/list_folders.rb'
290
+ - 'lib/fog/vsphere/requests/compute/list_interface_types.rb'
291
+ - 'lib/fog/vsphere/requests/compute/list_networks.rb'
292
+ - 'lib/fog/vsphere/requests/compute/list_server_types.rb'
293
+ - 'lib/fog/vsphere/requests/compute/vm_config_vnc.rb'
96
294
 
97
- Naming/FileName:
295
+ # Offense count: 4
296
+ Performance/MethodObjectAsBlock:
98
297
  Exclude:
99
- - 'lib/fog-vsphere.rb'
298
+ - 'lib/fog/vsphere/requests/compute/list_folders.rb'
299
+ - 'lib/fog/vsphere/requests/compute/list_templates.rb'
300
+ - 'lib/fog/vsphere/requests/compute/list_virtual_machines.rb'
301
+
302
+ # Offense count: 8
303
+ # This cop supports unsafe autocorrection (--autocorrect-all).
304
+ Performance/RedundantEqualityComparisonBlock:
305
+ Exclude:
306
+ - 'tests/requests/compute/list_child_snapshots_tests.rb'
307
+ - 'tests/requests/compute/list_datastores_tests.rb'
308
+ - 'tests/requests/compute/list_hosts_tests.rb'
309
+ - 'tests/requests/compute/list_networks_tests.rb'
310
+ - 'tests/requests/compute/list_vm_cdroms_tests.rb'
311
+ - 'tests/requests/compute/list_vm_snapshots_tests.rb'
312
+
313
+ # Offense count: 7
314
+ # This cop supports safe autocorrection (--autocorrect).
315
+ Performance/StringIdentifierArgument:
316
+ Exclude:
317
+ - 'tests/models/compute/server_tests.rb'
318
+
319
+ # Offense count: 1
320
+ # This cop supports safe autocorrection (--autocorrect).
321
+ Rake/Desc:
322
+ Exclude:
323
+ - 'Rakefile'
324
+
325
+ # Offense count: 12
326
+ # This cop supports safe autocorrection (--autocorrect).
327
+ # Configuration parameters: EnforcedStyle.
328
+ # SupportedStyles: separated, grouped
329
+ Style/AccessorGrouping:
330
+ Exclude:
331
+ - 'lib/fog/vsphere/compute.rb'
332
+ - 'lib/fog/vsphere/models/compute/interfacetypes.rb'
333
+ - 'lib/fog/vsphere/models/compute/servers.rb'
100
334
 
101
335
  # Offense count: 10
336
+ # This cop supports safe autocorrection (--autocorrect).
337
+ # Configuration parameters: AllowOnConstant, AllowOnSelfClass.
102
338
  Style/CaseEquality:
103
339
  Exclude:
104
340
  - 'lib/fog/vsphere/requests/compute/list_child_snapshots.rb'
@@ -110,36 +346,108 @@ Style/CaseEquality:
110
346
  - 'tests/requests/compute/list_vm_cdroms_tests.rb'
111
347
  - 'tests/requests/compute/list_vm_snapshots_tests.rb'
112
348
 
349
+ # Offense count: 8
350
+ # This cop supports unsafe autocorrection (--autocorrect-all).
351
+ Style/CaseLikeIf:
352
+ Exclude:
353
+ - 'lib/fog/vsphere/requests/compute/create_group.rb'
354
+ - 'lib/fog/vsphere/requests/compute/create_rule.rb'
355
+ - 'lib/fog/vsphere/requests/compute/create_vm.rb'
356
+ - 'lib/fog/vsphere/requests/compute/list_clusters.rb'
357
+ - 'lib/fog/vsphere/requests/compute/list_datacenters.rb'
358
+ - 'lib/fog/vsphere/requests/compute/list_networks.rb'
359
+ - 'lib/fog/vsphere/requests/compute/list_rules.rb'
360
+
361
+ # Offense count: 3
362
+ # This cop supports safe autocorrection (--autocorrect).
363
+ # Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods.
364
+ # AllowedMethods: ==, equal?, eql?
365
+ Style/ClassEqualityComparison:
366
+ Exclude:
367
+ - 'lib/fog/vsphere/requests/compute/create_folder.rb'
368
+ - 'lib/fog/vsphere/requests/compute/list_vm_cdroms.rb'
369
+ - 'lib/fog/vsphere/requests/compute/vm_clone.rb'
370
+
113
371
  # Offense count: 1
114
372
  Style/ClassVars:
115
373
  Exclude:
116
374
  - 'lib/fog/bin/vsphere.rb'
117
375
 
118
- # Offense count: 1
119
- Style/DoubleNegation:
376
+ # Offense count: 2
377
+ # This cop supports unsafe autocorrection (--autocorrect-all).
378
+ Style/CollectionCompact:
120
379
  Exclude:
121
- - 'tests/helpers/succeeds_helper.rb'
380
+ - 'lib/fog/vsphere/requests/compute/list_folders.rb'
381
+ - 'lib/fog/vsphere/requests/compute/list_virtual_machines.rb'
122
382
 
123
- # Offense count: 14
124
- # Configuration parameters: MinBodyLength.
125
- Style/GuardClause:
383
+ # Offense count: 3
384
+ # This cop supports safe autocorrection (--autocorrect).
385
+ Style/ExpandPathArguments:
386
+ Exclude:
387
+ - 'fog-vsphere.gemspec'
388
+ - 'lib/fog/vsphere.rb'
389
+ - 'tests/helper.rb'
390
+
391
+ # Offense count: 185
392
+ # This cop supports unsafe autocorrection (--autocorrect-all).
393
+ # Configuration parameters: EnforcedStyle.
394
+ # SupportedStyles: always, always_true, never
395
+ Style/FrozenStringLiteralComment:
396
+ Enabled: false
397
+
398
+ # Offense count: 2
399
+ # This cop supports safe autocorrection (--autocorrect).
400
+ # Configuration parameters: AllowSplatArgument.
401
+ Style/HashConversion:
126
402
  Exclude:
127
403
  - 'lib/fog/vsphere/compute.rb'
404
+ - 'lib/fog/vsphere/requests/compute/vm_config_vnc.rb'
405
+
406
+ # Offense count: 2
407
+ # This cop supports unsafe autocorrection (--autocorrect-all).
408
+ Style/HashTransformKeys:
409
+ Exclude:
410
+ - 'lib/fog/vsphere/models/compute/server.rb'
411
+
412
+ # Offense count: 1
413
+ # This cop supports unsafe autocorrection (--autocorrect-all).
414
+ Style/HashTransformValues:
415
+ Exclude:
416
+ - 'lib/fog/vsphere/requests/compute/list_hosts.rb'
417
+
418
+ # Offense count: 2
419
+ # This cop supports safe autocorrection (--autocorrect).
420
+ # Configuration parameters: AllowIfModifier.
421
+ Style/IfInsideElse:
422
+ Exclude:
423
+ - 'lib/fog/vsphere/models/compute/cdrom.rb'
424
+ - 'lib/fog/vsphere/models/compute/volume.rb'
425
+
426
+ # Offense count: 27
427
+ # This cop supports safe autocorrection (--autocorrect).
428
+ Style/IfUnlessModifier:
429
+ Exclude:
430
+ - 'lib/fog/vsphere/models/compute/cdrom.rb'
431
+ - 'lib/fog/vsphere/models/compute/interface.rb'
128
432
  - 'lib/fog/vsphere/models/compute/interfaces.rb'
129
433
  - 'lib/fog/vsphere/models/compute/rule.rb'
130
- - 'lib/fog/vsphere/models/compute/server.rb'
434
+ - 'lib/fog/vsphere/models/compute/volume.rb'
131
435
  - 'lib/fog/vsphere/requests/compute/create_group.rb'
132
436
  - 'lib/fog/vsphere/requests/compute/create_rule.rb'
133
437
  - 'lib/fog/vsphere/requests/compute/create_vm.rb'
438
+ - 'lib/fog/vsphere/requests/compute/folder_destroy.rb'
439
+ - 'lib/fog/vsphere/requests/compute/list_groups.rb'
134
440
  - 'lib/fog/vsphere/requests/compute/list_resource_pools.rb'
135
441
  - 'lib/fog/vsphere/requests/compute/list_server_types.rb'
136
- - 'lib/fog/vsphere/requests/compute/vm_relocate.rb'
442
+ - 'lib/fog/vsphere/requests/compute/revert_to_snapshot.rb'
443
+ - 'lib/fog/vsphere/requests/compute/vm_clone.rb'
444
+ - 'lib/fog/vsphere/requests/compute/vm_config_vnc.rb'
137
445
 
138
- # Offense count: 2
139
- Style/IfInsideElse:
446
+ # Offense count: 1
447
+ # This cop supports unsafe autocorrection (--autocorrect-all).
448
+ Style/MapToHash:
140
449
  Exclude:
141
- - 'lib/fog/vsphere/models/compute/cdrom.rb'
142
- - 'lib/fog/vsphere/models/compute/volume.rb'
450
+ - 'lib/fog/vsphere/compute.rb'
143
451
 
144
452
  # Offense count: 2
145
453
  Style/MultilineBlockChain:
@@ -147,46 +455,104 @@ Style/MultilineBlockChain:
147
455
  - 'lib/fog/vsphere/requests/compute/vm_clone.rb'
148
456
 
149
457
  # Offense count: 4
458
+ # This cop supports safe autocorrection (--autocorrect).
150
459
  Style/MultilineTernaryOperator:
151
460
  Exclude:
152
461
  - 'lib/fog/vsphere/models/compute/cluster.rb'
153
462
  - 'lib/fog/vsphere/requests/compute/list_child_snapshots.rb'
154
463
 
155
- # Offense count: 1
156
- # Cop supports --auto-correct.
157
- # Configuration parameters: AutoCorrect, EnforcedStyle, SupportedStyles.
464
+ # Offense count: 2
465
+ # This cop supports safe autocorrection (--autocorrect).
466
+ # Configuration parameters: Strict, AllowedNumbers, AllowedPatterns.
467
+ Style/NumericLiterals:
468
+ MinDigits: 6
469
+
470
+ # Offense count: 4
471
+ # This cop supports unsafe autocorrection (--autocorrect-all).
472
+ # Configuration parameters: EnforcedStyle, AllowedMethods, AllowedPatterns, IgnoredMethods.
158
473
  # SupportedStyles: predicate, comparison
159
474
  Style/NumericPredicate:
160
475
  Exclude:
161
476
  - 'spec/**/*'
162
477
  - 'lib/fog/vsphere/requests/compute/list_compute_resources.rb'
478
+ - 'lib/fog/vsphere/requests/compute/modify_vm_interface.rb'
479
+ - 'tests/models/compute/rules_tests.rb'
480
+
481
+ # Offense count: 3
482
+ Style/OpenStructUse:
483
+ Exclude:
484
+ - 'tests/requests/compute/get_network_tests.rb'
485
+
486
+ # Offense count: 7
487
+ # Configuration parameters: AllowedMethods.
488
+ # AllowedMethods: respond_to_missing?
489
+ Style/OptionalBooleanParameter:
490
+ Exclude:
491
+ - 'lib/fog/vsphere/models/compute/snapshot.rb'
492
+ - 'lib/fog/vsphere/requests/compute/get_virtual_machine.rb'
493
+ - 'lib/fog/vsphere/requests/compute/host_shutdown.rb'
494
+ - 'lib/fog/vsphere/requests/compute/host_start_maintenance.rb'
495
+ - 'lib/fog/vsphere/requests/compute/vm_remove_snapshot.rb'
163
496
 
164
497
  # Offense count: 1
165
- # Cop supports --auto-correct.
498
+ # This cop supports safe autocorrection (--autocorrect).
166
499
  # Configuration parameters: PreferredDelimiters.
167
500
  Style/PercentLiteralDelimiters:
168
501
  Exclude:
169
502
  - 'Rakefile'
170
503
 
171
504
  # Offense count: 1
172
- # Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist.
173
- # NamePrefix: is_, has_, have_
174
- # NamePrefixBlacklist: is_, has_, have_
175
- # NameWhitelist: is_a?
176
- Style/PredicateName:
505
+ # This cop supports safe autocorrection (--autocorrect).
506
+ Style/RedundantAssignment:
507
+ Exclude:
508
+ - 'lib/fog/vsphere/requests/compute/vm_clone.rb'
509
+
510
+ # Offense count: 6
511
+ # This cop supports safe autocorrection (--autocorrect).
512
+ Style/RedundantBegin:
177
513
  Exclude:
178
- - 'spec/**/*'
179
514
  - 'lib/fog/vsphere/compute.rb'
515
+ - 'lib/fog/vsphere/requests/compute/get_virtual_machine.rb'
516
+ - 'lib/fog/vsphere/requests/compute/list_hosts.rb'
517
+ - 'lib/fog/vsphere/requests/compute/vm_clone.rb'
518
+
519
+ # Offense count: 3
520
+ # This cop supports safe autocorrection (--autocorrect).
521
+ Style/RedundantCondition:
522
+ Exclude:
523
+ - 'lib/fog/vsphere/requests/compute/create_vm.rb'
524
+ - 'lib/fog/vsphere/requests/compute/get_virtual_machine.rb'
525
+
526
+ # Offense count: 2
527
+ # This cop supports safe autocorrection (--autocorrect).
528
+ Style/RedundantRegexpEscape:
529
+ Exclude:
530
+ - 'fog-vsphere.gemspec'
531
+ - 'lib/fog/vsphere/requests/compute/list_clusters.rb'
532
+
533
+ # Offense count: 2
534
+ # This cop supports safe autocorrection (--autocorrect).
535
+ # Configuration parameters: AllowMultipleReturnValues.
536
+ Style/RedundantReturn:
537
+ Exclude:
538
+ - 'lib/fog/vsphere/requests/compute/create_group.rb'
539
+ - 'lib/fog/vsphere/requests/compute/create_rule.rb'
180
540
 
181
541
  # Offense count: 2
182
- # Cop supports --auto-correct.
542
+ # This cop supports safe autocorrection (--autocorrect).
183
543
  Style/RedundantSelf:
184
544
  Exclude:
185
545
  - 'lib/fog/vsphere/models/compute/volume.rb'
186
546
 
547
+ # Offense count: 1
548
+ # This cop supports unsafe autocorrection (--autocorrect-all).
549
+ Style/RedundantSort:
550
+ Exclude:
551
+ - 'lib/fog/vsphere/models/compute/interface.rb'
552
+
187
553
  # Offense count: 3
188
- # Cop supports --auto-correct.
189
- # Configuration parameters: EnforcedStyle, SupportedStyles, AllowInnerSlashes.
554
+ # This cop supports safe autocorrection (--autocorrect).
555
+ # Configuration parameters: EnforcedStyle, AllowInnerSlashes.
190
556
  # SupportedStyles: slashes, percent_r, mixed
191
557
  Style/RegexpLiteral:
192
558
  Exclude:
@@ -194,20 +560,55 @@ Style/RegexpLiteral:
194
560
  - 'lib/fog/vsphere/requests/compute/get_folder.rb'
195
561
  - 'lib/fog/vsphere/requests/compute/list_resource_pools.rb'
196
562
 
197
- # Offense count: 1
198
- # Cop supports --auto-correct.
563
+ # Offense count: 14
564
+ # This cop supports safe autocorrection (--autocorrect).
565
+ # Configuration parameters: EnforcedStyle.
566
+ # SupportedStyles: implicit, explicit
567
+ Style/RescueStandardError:
568
+ Exclude:
569
+ - 'lib/fog/vsphere/compute.rb'
570
+ - 'lib/fog/vsphere/requests/compute/list_hosts.rb'
571
+ - 'lib/fog/vsphere/requests/compute/list_vm_cdroms.rb'
572
+ - 'lib/fog/vsphere/requests/compute/list_vm_volumes.rb'
573
+
574
+ # Offense count: 9
575
+ # This cop supports unsafe autocorrection (--autocorrect-all).
576
+ # Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength.
577
+ # AllowedMethods: present?, blank?, presence, try, try!
578
+ Style/SafeNavigation:
579
+ Exclude:
580
+ - 'lib/fog/vsphere/models/compute/server.rb'
581
+ - 'lib/fog/vsphere/requests/compute/create_vm.rb'
582
+ - 'lib/fog/vsphere/requests/compute/list_server_types.rb'
583
+ - 'lib/fog/vsphere/requests/compute/modify_vm_interface.rb'
584
+
585
+ # Offense count: 2
586
+ # This cop supports safe autocorrection (--autocorrect).
199
587
  # Configuration parameters: AllowAsExpressionSeparator.
200
588
  Style/Semicolon:
201
589
  Exclude:
202
590
  - 'tests/models/compute/rules_tests.rb'
203
591
 
204
- # Offense count: 14
205
- # Configuration parameters: EnforcedStyle, SupportedStyles.
206
- # SupportedStyles: snake_case, camelCase
207
- Style/VariableName:
592
+ # Offense count: 1
593
+ # This cop supports safe autocorrection (--autocorrect).
594
+ # Configuration parameters: AllowModifier.
595
+ Style/SoleNestedConditional:
208
596
  Exclude:
209
- - 'lib/fog/vsphere/requests/compute/create_vm.rb'
210
- - 'lib/fog/vsphere/requests/compute/list_datacenters.rb'
211
- - 'lib/fog/vsphere/requests/compute/list_resource_pools.rb'
212
- - 'lib/fog/vsphere/requests/compute/list_server_types.rb'
213
597
  - 'lib/fog/vsphere/requests/compute/vm_clone.rb'
598
+
599
+ # Offense count: 5
600
+ # This cop supports unsafe autocorrection (--autocorrect-all).
601
+ # Configuration parameters: Mode.
602
+ Style/StringConcatenation:
603
+ Exclude:
604
+ - 'lib/fog/vsphere/compute.rb'
605
+ - 'lib/fog/vsphere/requests/compute/get_folder.rb'
606
+ - 'lib/fog/vsphere/requests/compute/upload_iso.rb'
607
+ - 'lib/fog/vsphere/requests/compute/vm_clone.rb'
608
+
609
+ # Offense count: 174
610
+ # This cop supports safe autocorrection (--autocorrect).
611
+ # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, IgnoredPatterns.
612
+ # URISchemes: http, https
613
+ Layout/LineLength:
614
+ Max: 317
data/CHANGELOG.md CHANGED
@@ -1,3 +1,20 @@
1
+ ## 3.6.0
2
+ * Switch to rbvmomi2 (#281)
3
+ * Raise the minimum Ruby version to 2.7 (#280)
4
+ * Set server tests to pending
5
+ * Remove simplecov setup
6
+ * Update vcr to 6.x
7
+ * Update Rubocop to 1.39.x
8
+ * Raise the minimum Ruby version to 2.7
9
+ * Convert to GitHub Actions
10
+
11
+ ## 3.5.2
12
+ * Avoid unneeded "get_raw_datacenter" call (#277)
13
+ * New NIC ID decrements from initial random int to avoid collisions (#275)
14
+
15
+ ## v3.5.1
16
+ * Creating ESX compute resource on vcenter 7.x fails with InvalidArgument: A specified parameter was not correct: deviceChange[1].device.key (#272)
17
+
1
18
  ## v3.5.0
2
19
  * Clone vm from different datacenter (#263)
3
20
  * Fix autoload issues (#267)
data/CONTRIBUTORS.md CHANGED
@@ -18,6 +18,7 @@
18
18
  * Francois Herbert <fherbert@oss.co.nz>
19
19
  * Francois Herbert <francois@herbert.org.nz>
20
20
  * Guido Günther <agx@sigxcpu.org>
21
+ * Hao Chang Yu <hyu@redhat.com>
21
22
  * Ivan Nečas <inecas@redhat.com>
22
23
  * Ivo Reznicek <ireznice@googlemail.com>
23
24
  * J.R. Garcia <jr@garciaole.com>
@@ -53,6 +54,7 @@
53
54
  * Ohad Levy <ohadlevy@redhat.com>
54
55
  * Ondrej Prazak <oprazak@redhat.com>
55
56
  * Oscar Elfving <sofam84@gmail.com>
57
+ * Pablo Hess <phess@redhat.com>
56
58
  * Paul Thornthwaite <paul@brightbox.co.uk>
57
59
  * Paul Thornthwaite <tokengeek@gmail.com>
58
60
  * Paulo Henrique Lopes Ribeiro <plribeiro3000@gmail.com>
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  > VMware vSphere® provider for the Fog cloud services library
4
4
 
5
- [![Gem Version][gemfury-image]][gemfury-url] [![Build Status][travis-image]][travis-url] [![Test Coverage][coverage-image]][coverage-url] [![Code Climate][climate-image]][climate-url]
5
+ [![Gem Version][gemfury-image]][gemfury-url] [![Build Status][gha-image]][gha-url] [![Test Coverage][coverage-image]][coverage-url] [![Code Climate][climate-image]][climate-url]
6
6
 
7
7
  The VMware vSphere® provider allows you to use the abstractions of the Fog cloud services library to communicate with vSphere.
8
8
 
@@ -95,5 +95,5 @@ For more details see [CONTRIBUTING.md file](CONTRIBUTING.md)
95
95
  [coverage-url]: https://codeclimate.com/github/fog/fog-vsphere/coverage
96
96
  [gemfury-image]: https://badge.fury.io/rb/fog-vsphere.svg
97
97
  [gemfury-url]: http://badge.fury.io/rb/fog-vsphere
98
- [travis-image]: https://travis-ci.org/fog/fog-vsphere.svg?branch=master
99
- [travis-url]: https://travis-ci.org/fog/fog-vsphere
98
+ [gha-image]: TODO
99
+ [gha-url]: TODO
data/Rakefile CHANGED
@@ -4,11 +4,6 @@ require 'rubocop/rake_task'
4
4
  desc 'Run Ruby style checks'
5
5
  RuboCop::RakeTask.new(:style)
6
6
 
7
- namespace :travis do
8
- desc 'Run tests on Travis'
9
- task ci: %w(style test)
10
- end
11
-
12
7
  mock = ENV['FOG_MOCK'] || 'true'
13
8
  task :test do
14
9
  sh("export FOG_MOCK=#{mock} && bundle exec shindont")
data/fog-vsphere.gemspec CHANGED
@@ -19,18 +19,21 @@ Gem::Specification.new do |spec|
19
19
 
20
20
  spec.require_paths = ['lib']
21
21
 
22
- spec.required_ruby_version = '>= 2.0.0'
22
+ spec.required_ruby_version = '>= 2.7'
23
23
 
24
24
  spec.add_runtime_dependency 'fog-core'
25
- spec.add_runtime_dependency 'rbvmomi', '>= 1.9', '< 3'
25
+ spec.add_runtime_dependency 'rbvmomi2', '~> 3.0'
26
26
 
27
27
  spec.add_development_dependency 'bundler'
28
28
  spec.add_development_dependency 'pry', '~> 0.10'
29
29
  spec.add_development_dependency 'rake', '>= 12.3.3'
30
30
  spec.add_development_dependency 'minitest', '~> 5.8'
31
- spec.add_development_dependency 'rubocop', '~> 0.50.0'
31
+ spec.add_development_dependency 'rubocop', '~> 1.39.0'
32
+ spec.add_development_dependency 'rubocop-minitest'
33
+ spec.add_development_dependency 'rubocop-performance'
34
+ spec.add_development_dependency 'rubocop-rake'
32
35
  spec.add_development_dependency 'mocha', '~> 1.8'
33
36
  spec.add_development_dependency 'shindo', '~> 0.3'
34
37
  spec.add_development_dependency 'webmock', '~> 3.5'
35
- spec.add_development_dependency 'vcr', '~> 4.0'
38
+ spec.add_development_dependency 'vcr', '~> 6.0'
36
39
  end
@@ -11,7 +11,7 @@ module Fog
11
11
  protected
12
12
 
13
13
  def find_raw_datacenter(name)
14
- raw_datacenters.find { |d| d.name == name } || get_raw_datacenter(name)
14
+ raw_datacenters.find { |d| d.name == name || raw_getpathmo(d).join('/') == name } || get_raw_datacenter(name)
15
15
  end
16
16
 
17
17
  # @note RbVmomi takes path instead of name as argument to find datacenter
@@ -38,7 +38,7 @@ module Fog
38
38
  # only the one will do
39
39
  proc do |n|
40
40
  n._ref == ref_or_name || (
41
- n.is_a?(RbVmomi::VIM::DistributedVirtualPortgroup) && (n.name == ref_or_name || n.key == ref_or_name) &&
41
+ n.is_a?(RbVmomi::VIM::DistributedVirtualPortgroup) && (n.name == ref_or_name) &&
42
42
  (n.config.distributedVirtualSwitch.name == distributedswitch)
43
43
  )
44
44
  end
@@ -46,12 +46,12 @@ module Fog
46
46
  # the first distributed virtual switch will do - selected by network - gives control to vsphere
47
47
  proc do |n|
48
48
  n._ref == ref_or_name || (
49
- n.is_a?(RbVmomi::VIM::DistributedVirtualPortgroup) && (n.name == ref_or_name || n.key == ref_or_name)
49
+ n.is_a?(RbVmomi::VIM::DistributedVirtualPortgroup) && (n.name == ref_or_name)
50
50
  )
51
51
  end
52
52
  else
53
53
  # the first matching network will do, seems like the non-distributed networks come first
54
- proc { |n| n._ref == ref_or_name || n.name == ref_or_name || (n.is_a?(RbVmomi::VIM::DistributedVirtualPortgroup) && n.key == ref_or_name) }
54
+ proc { |n| n._ref == ref_or_name || n.name == ref_or_name }
55
55
  end
56
56
  end
57
57
  end
@@ -30,17 +30,15 @@ module Fog
30
30
  virtualswitch: dvswitches[network['config.distributedVirtualSwitch']._ref]
31
31
  )
32
32
  elsif network.obj.is_a?(RbVmomi::VIM::OpaqueNetwork)
33
- map_attrs_to_hash(network, network_dvportgroup_attribute_mapping).merge(
34
- id: network.obj._ref,
33
+ map_attrs_to_hash(network, network_attribute_mapping).merge(
35
34
  opaqueNetworkId: network.obj.summary.opaqueNetworkId
36
35
  )
37
36
  else
38
- map_attrs_to_hash(network, network_attribute_mapping).merge(
39
- id: network.obj._ref
40
- )
37
+ map_attrs_to_hash(network, network_attribute_mapping)
41
38
  end.merge(
42
- datacenter: datacenter_name,
43
- _ref: network.obj._ref
39
+ _ref: network.obj._ref,
40
+ id: managed_obj_id(network.obj),
41
+ datacenter: datacenter_name
44
42
  )
45
43
  end.compact
46
44
  end
@@ -56,7 +54,7 @@ module Fog
56
54
 
57
55
  def network_dvportgroup_attribute_mapping
58
56
  network_attribute_mapping.merge(
59
- id: 'config.key'
57
+ dvp_uuid: 'config.key'
60
58
  )
61
59
  end
62
60
 
@@ -37,7 +37,7 @@ module Fog
37
37
  end
38
38
  end
39
39
 
40
- # rubocop:disable ClassLength
40
+ # rubocop:disable Metrics/ClassLength
41
41
  class Real
42
42
  include Shared
43
43
 
@@ -811,8 +811,11 @@ module Fog
811
811
  end
812
812
  end
813
813
 
814
+ new_nic_baseid = -rand(25000..29999)
814
815
  new_nics.each do |interface|
815
- specs << create_interface(interface, 0, :add, datacenter: datacenter)
816
+ new_nic_id = new_nic_baseid
817
+ new_nic_baseid-=1
818
+ specs << create_interface(interface, new_nic_id, :add, datacenter: datacenter)
816
819
  end
817
820
 
818
821
  specs
@@ -884,7 +887,7 @@ module Fog
884
887
  end
885
888
  end
886
889
 
887
- # rubocop:enable ClassLength
890
+ # rubocop:enable Metrics/ClassLength
888
891
  class Mock
889
892
  include Shared
890
893
  def vm_clone(options = {})
@@ -5,13 +5,17 @@ module Fog
5
5
  def vm_take_snapshot(options = {})
6
6
  raise ArgumentError, 'instance_uuid is a required parameter' unless options.key? 'instance_uuid'
7
7
  raise ArgumentError, 'name is a required parameter' unless options.key? 'name'
8
+ defaults = {
9
+ description: '',
10
+ memory: true,
11
+ quiesce: false
12
+ }
13
+ opts = options.clone
14
+ defaults.each do |k, v|
15
+ opts[k] = v unless opts.key?(k) || opts.key?(k.to_s)
16
+ end
8
17
  vm = get_vm_ref(options['instance_uuid'])
9
- task = vm.CreateSnapshot_Task(
10
- name: options['name'],
11
- description: options['description'] || '',
12
- memory: options['memory'] || true,
13
- quiesce: options['quiesce'] || false
14
- )
18
+ task = vm.CreateSnapshot_Task(opts)
15
19
 
16
20
  task.wait_for_completion
17
21
 
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module Vsphere
3
- VERSION = '3.5.0'.freeze
3
+ VERSION = '3.6.0'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-vsphere
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.0
4
+ version: 3.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - J.R. Garcia
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-09 00:00:00.000000000 Z
11
+ date: 2022-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fog-core
@@ -25,25 +25,19 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: rbvmomi
28
+ name: rbvmomi2
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '1.9'
34
- - - "<"
31
+ - - "~>"
35
32
  - !ruby/object:Gem::Version
36
- version: '3'
33
+ version: '3.0'
37
34
  type: :runtime
38
35
  prerelease: false
39
36
  version_requirements: !ruby/object:Gem::Requirement
40
37
  requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- version: '1.9'
44
- - - "<"
38
+ - - "~>"
45
39
  - !ruby/object:Gem::Version
46
- version: '3'
40
+ version: '3.0'
47
41
  - !ruby/object:Gem::Dependency
48
42
  name: bundler
49
43
  requirement: !ruby/object:Gem::Requirement
@@ -106,14 +100,56 @@ dependencies:
106
100
  requirements:
107
101
  - - "~>"
108
102
  - !ruby/object:Gem::Version
109
- version: 0.50.0
103
+ version: 1.39.0
110
104
  type: :development
111
105
  prerelease: false
112
106
  version_requirements: !ruby/object:Gem::Requirement
113
107
  requirements:
114
108
  - - "~>"
115
109
  - !ruby/object:Gem::Version
116
- version: 0.50.0
110
+ version: 1.39.0
111
+ - !ruby/object:Gem::Dependency
112
+ name: rubocop-minitest
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rubocop-performance
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: rubocop-rake
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
117
153
  - !ruby/object:Gem::Dependency
118
154
  name: mocha
119
155
  requirement: !ruby/object:Gem::Requirement
@@ -162,14 +198,14 @@ dependencies:
162
198
  requirements:
163
199
  - - "~>"
164
200
  - !ruby/object:Gem::Version
165
- version: '4.0'
201
+ version: '6.0'
166
202
  type: :development
167
203
  prerelease: false
168
204
  version_requirements: !ruby/object:Gem::Requirement
169
205
  requirements:
170
206
  - - "~>"
171
207
  - !ruby/object:Gem::Version
172
- version: '4.0'
208
+ version: '6.0'
173
209
  description: This library can be used as a module for `fog` or as standalone provider
174
210
  to use vSphere in applications.
175
211
  email:
@@ -178,10 +214,10 @@ executables: []
178
214
  extensions: []
179
215
  extra_rdoc_files: []
180
216
  files:
217
+ - ".github/workflows/ruby.yml"
181
218
  - ".gitignore"
182
219
  - ".rubocop.yml"
183
220
  - ".rubocop_todo.yml"
184
- - ".travis.yml"
185
221
  - CHANGELOG.md
186
222
  - CONTRIBUTING.md
187
223
  - CONTRIBUTORS.md
@@ -323,7 +359,7 @@ homepage: https://github.com/fog/fog-vsphere
323
359
  licenses:
324
360
  - MIT
325
361
  metadata: {}
326
- post_install_message:
362
+ post_install_message:
327
363
  rdoc_options: []
328
364
  require_paths:
329
365
  - lib
@@ -331,15 +367,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
331
367
  requirements:
332
368
  - - ">="
333
369
  - !ruby/object:Gem::Version
334
- version: 2.0.0
370
+ version: '2.7'
335
371
  required_rubygems_version: !ruby/object:Gem::Requirement
336
372
  requirements:
337
373
  - - ">="
338
374
  - !ruby/object:Gem::Version
339
375
  version: '0'
340
376
  requirements: []
341
- rubygems_version: 3.1.4
342
- signing_key:
377
+ rubygems_version: 3.3.26
378
+ signing_key:
343
379
  specification_version: 4
344
380
  summary: Module for the 'fog' gem to support VMware vSphere.
345
381
  test_files: []
data/.travis.yml DELETED
@@ -1,23 +0,0 @@
1
- language: ruby
2
- sudo: false
3
- matrix:
4
- allow_failures:
5
- - rvm: jruby-head
6
- fast_finish: true
7
- include:
8
- - rvm: 2.0.0
9
- gemfile: Gemfile
10
- - rvm: 2.1.10
11
- gemfile: Gemfile
12
- - rvm: 2.2.6
13
- gemfile: Gemfile
14
- - rvm: 2.3.3
15
- gemfile: Gemfile
16
- - rvm: 2.4.0
17
- gemfile: Gemfile
18
- - rvm: jruby-head
19
- gemfile: Gemfile
20
- script: bundle exec rake travis:ci
21
- notifications:
22
- email:
23
- - chrobert@redhat.com