fog-vsphere 1.5.1 → 1.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: edb0cd00d29fa95192e3d5a70f3f08d72c9a1221
4
- data.tar.gz: f296c0b6fad69fb59c581c225af17398087a377d
3
+ metadata.gz: fc6ccb1f44c8afade6e70efc449d05184c446f52
4
+ data.tar.gz: 39d5496413d90ce5b393e43e110f03f87565c07e
5
5
  SHA512:
6
- metadata.gz: 0954d0617378088536af6d5099f39ff26097ed09069e8abf9eec1386c12aea659bf72847e05679064a9938a487f8e69c21bb8f1ec0164f62e7b526c26d471bde
7
- data.tar.gz: 02cfbb0004d8e8cfec927052b0615eac8aefe2a24e4142495e2e3a256cfd05af05d6be642a67e606be213213321a4a03151da4d5b79a40b61b01ad21fa7fd774
6
+ metadata.gz: b638f779c9567d64812575781c204ca1c5ae6b7c2efff64520383c09f67941661f8f70dff3ce4feb59718f83c972cb4ac69d8d26de1c139dd08734342a8ff204
7
+ data.tar.gz: 8dd2017c1de9dc207c280b02c0d768d757cfc29db69e9627392e61433788e7aa29946f1cad921d8b05225b18b7615422d5268adbc7bbb9b56634d51df7c1be3b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## v1.5.2
2
+
3
+ * Handle vSphere VMs being created or removed when searching for VM
4
+
1
5
  ## v1.5.1
2
6
 
3
7
  * Move volume key generation to volume model
data/CONTRIBUTORS.md CHANGED
@@ -14,6 +14,7 @@
14
14
  * Francois Herbert <F.Herbert@massey.ac.nz>
15
15
  * Francois Herbert <fherbert@oss.co.nz>
16
16
  * Francois Herbert <francois@herbert.org.nz>
17
+ * Guido Günther <agx@sigxcpu.org>
17
18
  * Ivan Nečas <inecas@redhat.com>
18
19
  * Ivo Reznicek <ireznice@googlemail.com>
19
20
  * J.R. Garcia <jr@garciaole.com>
data/README.md CHANGED
@@ -1,31 +1,97 @@
1
- # Fog::Vsphere
1
+ # Fog vSphere
2
+ > VMware vSphere® provider for the Fog cloud services library
2
3
 
3
- [![Gem Version](https://badge.fury.io/rb/fog-vsphere.svg)](http://badge.fury.io/rb/fog-vsphere) [![Build Status](https://travis-ci.org/fog/fog-vsphere.svg?branch=master)](https://travis-ci.org/fog/fog-vsphere) [![Dependency Status](https://gemnasium.com/fog/fog-vsphere.svg)](https://gemnasium.com/fog/fog-vsphere) [![Test Coverage](https://codeclimate.com/github/fog/fog-vsphere/badges/coverage.svg)](https://codeclimate.com/github/fog/fog-vsphere/coverage) [![Code Climate](https://codeclimate.com/github/fog/fog-vsphere.png)](https://codeclimate.com/github/fog/fog-vsphere) [![Stories in Ready](https://badge.waffle.io/fog/fog-vsphere.png?label=ready&title=Ready)](https://waffle.io/fog/fog-vsphere)
4
+ [![Gem Version][gemfury-image]][gemfury-url]
5
+ [![Build Status][travis-image]][travis-url]
6
+ [![Dependency Status][gemnasium-image]][gemnasium-url]
7
+ [![Test Coverage][coverage-image]][coverage-url]
8
+ [![Code Climate][climate-image]][climate-url]
4
9
 
5
- TODO: Write a gem description
10
+ The VMware vSphere® provider allows you to use the abstractions of the Fog cloud services library to communicate with vSphere.
6
11
 
7
12
  ## Installation
8
13
 
9
- Add this line to your application's Gemfile:
14
+ To use this gem in your application, add this line to your Gemfile:
10
15
 
16
+ ```ruby
11
17
  gem 'fog-vsphere'
18
+ ```
12
19
 
13
20
  And then execute:
14
21
 
15
- $ bundle
22
+ ```bash
23
+ bundle
24
+ ```
16
25
 
17
26
  Or install it yourself as:
18
27
 
19
- $ gem install fog-vsphere
28
+ ```bash
29
+ gem install fog-vsphere
30
+ ```
20
31
 
21
32
  ## Usage
22
33
 
23
- TODO: Write usage instructions here
34
+ To connect to your vSphere instance with Fog vSphere:
35
+
36
+ ```ruby
37
+ require 'fog/vsphere'
38
+
39
+ compute = Fog::Compute.new(
40
+ provider: :vsphere,
41
+ vsphere_username: 'username',
42
+ vsphere_password: 'password',
43
+ vsphere_server: 'server.example.com',
44
+ vsphere_expected_pubkey_hash: '0123456789abcdef0123456789abcdef',
45
+ vsphere_ssl: true,
46
+ vsphere_rev: '6.0'
47
+ )
48
+ ```
49
+
50
+ From there you can create, destroy, list, and modify most things related to vSphere. Some examples include:
51
+
52
+ ```ruby
53
+ # continued from previous example
54
+
55
+ # List datacenters
56
+ compute.list_datacenters
57
+ #=> [{id: 'datacenter-1', name: 'DC1', path: ['DC1'], status: 'gray'},
58
+ #=> {id: 'datacenter-2', name: 'DC2', path: ['DC2'], status: 'gray'}]
59
+
60
+ # Get datacenter by name
61
+ compute.get_datacenter('DC1')
62
+ #=> {name: 'DC1', status: 'gray', path: ['DC1']}
63
+
64
+ # List virtual machines
65
+ compute.list_virtual_machines
66
+ #=> [{'id' => 'ab589f9a-af35-428e-9690-9b96587d86f3',
67
+ #=> 'name' => 'TestVM',
68
+ #=> 'uuid' => 'fc51eb7a-fa50-4d96-bd16-63972b49f52f',
69
+ #=> ...
70
+
71
+ # List a VM's SCSI controllers
72
+ compute.list_vm_scsi_controllers('ab589f9a-af35-428e-9690-9b96587d86f3')
73
+ #=> [<Fog::Compute::Vsphere::SCSIController
74
+ #=> shared_bus='noSharing',
75
+ #=> type='VirtualLsiLogicController',
76
+ #=> unit_number=7,
77
+ #=> key=1000,
78
+ #=> server_id=nil
79
+ #=> >]
80
+ ```
81
+
82
+ There is a lot more you can do as well! We are working on providing better documentation right now. For now, you can look at the [RubyDocs](http://www.rubydoc.info/gems/fog-vsphere/), browse what's available with [Pry](http://pryrepl.org/), and view the documentation for [Fog](http://fog.io). We hope to have much more documentation and plenty of examples soon.
24
83
 
25
84
  ## Contributing
26
85
 
27
- 1. Fork it ( https://github.com/fog/fog-vsphere/fork )
28
- 2. Create your feature branch (`git checkout -b my-new-feature`)
29
- 3. Commit your changes (`git commit -am 'Add some feature'`)
30
- 4. Push to the branch (`git push origin my-new-feature`)
31
- 5. Create a new Pull Request
86
+ To contribute to this project, add an issue or pull request. For more info on what that means or how to do it, see [this guide](https://guides.github.com/activities/contributing-to-open-source/#contributing) from GitHub.
87
+
88
+ [climate-image]: https://codeclimate.com/github/fog/fog-vsphere.svg
89
+ [climate-url]: https://codeclimate.com/github/fog/fog-vsphere
90
+ [coverage-image]: https://codeclimate.com/github/fog/fog-vsphere/badges/coverage.svg
91
+ [coverage-url]: https://codeclimate.com/github/fog/fog-vsphere/coverage
92
+ [gemfury-image]: https://badge.fury.io/rb/fog-vsphere.svg
93
+ [gemfury-url]: http://badge.fury.io/rb/fog-vsphere
94
+ [gemnasium-image]: https://gemnasium.com/fog/fog-vsphere.svg
95
+ [gemnasium-url]: https://gemnasium.com/fog/fog-vsphere
96
+ [travis-image]: https://travis-ci.org/fog/fog-vsphere.svg?branch=master
97
+ [travis-url]: https://travis-ci.org/fog/fog-vsphere
@@ -1,9 +1,9 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'codeclimate-test-reporter', group: :test, require: nil
4
-
3
+ gem 'codeclimate-test-reporter', '~> 1.0', group: :test, require: nil
4
+ gem 'json', '~> 1.8.0'
5
5
  gem 'net-ssh', '~> 2.9'
6
6
  gem 'rubocop', '~> 0.41.0'
7
- gem 'json', '~> 1.8.0'
7
+ gem 'simplecov', '~> 0.12.0'
8
8
 
9
9
  gemspec :path => '..'
@@ -40,12 +40,23 @@ module Fog
40
40
  if name.include?('/')
41
41
  folder = File.dirname(name)
42
42
  basename = File.basename(name)
43
- vms.find { |v| v["name"] == basename && v.parent.pretty_path.include?(folder) }
43
+ vms.find do |v|
44
+ begin
45
+ v["name"] == basename && v.parent.pretty_path.include?(folder)
46
+ rescue RbVmomi::VIM::ManagedObjectNotFound
47
+ false
48
+ end
49
+ end
44
50
  else
45
- vms.find { |v| v["name"] == name }
51
+ vms.find do |v|
52
+ begin
53
+ v["name"] == name
54
+ rescue RbVmomi::VIM::ManagedObjectNotFound
55
+ false
56
+ end
57
+ end
46
58
  end
47
- end
48
-
59
+ end
49
60
  end
50
61
 
51
62
  class Mock
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module Vsphere
3
- VERSION = '1.5.1'
3
+ VERSION = '1.5.2'
4
4
  end
5
5
  end
data/tests/helper.rb CHANGED
@@ -1,9 +1,5 @@
1
- begin
2
- require 'codeclimate-test-reporter'
3
- CodeClimate::TestReporter.start
4
- rescue LoadError => e
5
- $stderr.puts "not recording test coverage: #{e.inspect}"
6
- end
1
+ require 'simplecov'
2
+ SimpleCov.start
7
3
 
8
4
  require 'minitest/autorun'
9
5
 
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: 1.5.1
4
+ version: 1.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - J.R. Garcia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-07 00:00:00.000000000 Z
11
+ date: 2016-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fog-core