train-vsphere 1.0.0 → 1.0.1

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: baa259e959105f850bbf08c00722541d608fe392cb9a39d3d8743e189bbc85f5
4
- data.tar.gz: 1f4bb79dcc6a9fd466359a10bde359e292349b4fc22fc898de20ab65051c5924
3
+ metadata.gz: 9b45bbaca977baab3665dcf82c6bf5bf45eee8395f62a9bed78d90f4c6dd706e
4
+ data.tar.gz: c8e9860f5ef0f872a4f3cd9b5246a38be4e01453cc220f3d0a4ccce390b2e54f
5
5
  SHA512:
6
- metadata.gz: 79d39f4183add1adff0dbb9842c65951f8dd27c564ebfb3bd95b5054e37be262b39136c75c8a07a4adc9e71633e86292a3291326c1570e5d91dd95ab46db181f
7
- data.tar.gz: 2472d1e48065f7ceb8141ec7c71ca7c12033bb875f6a1a0c6a98903e90d4d72b93d3ca68cc134d04d9a05862ab8923be3df86e4496ea8da358c620cd0e3555aa
6
+ metadata.gz: 8b37d7d24f7018fc0cf6b341e5b7a1fd0b97be4d9f6258cbdaf4cd32efe65210fb916f5ae2ea6da9a146e6529662d8ef51b178ecbcd6b7f6b571a7f9b9536cf7
7
+ data.tar.gz: e316a66f1ad78db1ed9ba2e7cb46fe42b5b3bf577b09a6518fd0fa22aebb5f0fcec8790524090fc02426f892712b587de33ab848ade7e90c96aebcff735c42f5
data/README.md CHANGED
@@ -42,21 +42,25 @@ VSphereAutomation::Appliance::AccessConsolecliApi.new(@authtoken).get.value
42
42
 
43
43
  An example of a resource
44
44
  ```ruby
45
-
46
45
  class Vcsa < Inspec.resource(1)
47
46
  name 'vcsa'
48
47
  supports platform: 'vsphere'
49
48
  desc 'Use the vsphere audit resource to get information from the vSphere API'
50
49
 
51
50
  def initialize
52
- authenticate
51
+ begin
52
+ @auth_token = inspec.backend.authenticate
53
+ rescue VSphereAutomation::ApiError => e
54
+ fail Train::ClientError
55
+ end
53
56
  end
57
+
54
58
  def ssh
55
59
  begin
56
- return VSphereAutomation::Appliance::AccessConsolecliApi.new(@auth_token).get.value
60
+ return VSphereAutomation::Appliance::AccessConsolecliApi.new(@auth_token).get.value
57
61
 
58
62
  rescue VSphereAutomation::ApiError => e
59
- puts "Exception when calling AccessConsolecliApi->get: #{e}"
63
+ fail Train::ClientError
60
64
  end
61
65
  end
62
66
 
@@ -65,7 +69,8 @@ class Vcsa < Inspec.resource(1)
65
69
  end
66
70
 
67
71
  def authenticate
68
- @auth_token = inspec.backend.authenticate
72
+
73
+
69
74
  end
70
75
  end
71
76
 
@@ -87,6 +92,7 @@ control 'vcenter-appliance-VCSA-001-1' do # A unique ID f
87
92
  its('ssh') {should cmp 'false'}
88
93
  end
89
94
  end
95
+ ```
90
96
 
91
97
 
92
98
 
@@ -36,7 +36,8 @@ module TrainPlugins
36
36
 
37
37
 
38
38
  def uri
39
- "vsphere://#{options[:hostname]}"
39
+ #Report vsphere URI
40
+ "vsphere://#{options[:host]}"
40
41
  end
41
42
 
42
43
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module TrainPlugins
4
4
  module Vsphere
5
- VERSION = '1.0.0'
5
+ VERSION = '1.0.1'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: train-vsphere
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sjors Robroek
@@ -47,7 +47,6 @@ extra_rdoc_files: []
47
47
  files:
48
48
  - Gemfile
49
49
  - README.md
50
- - lib/test.rb
51
50
  - lib/train-vsphere.rb
52
51
  - lib/train-vsphere/connection.rb
53
52
  - lib/train-vsphere/platform.rb
data/lib/test.rb DELETED
@@ -1,4 +0,0 @@
1
- basename = File.basename(__FILE__, ".rb")
2
- libdir = File.expand_path("../#{basename}",__FILE__)
3
- puts basename
4
- puts libdir