vmesh 0.1.7 → 0.1.11
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 +4 -4
- data/Gemfile.lock +3 -3
- data/bin/vmesh +3 -1
- data/lib/vmesh/commands/create.rb +3 -0
- data/lib/vmesh/ping_helper.rb +18 -0
- data/lib/vmesh/version.rb +1 -1
- data/lib/vmesh/vsphere.rb +1 -1
- data/lib/vmesh.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16b4f7444b68395227a86910e9dd5d826c763ff4
|
4
|
+
data.tar.gz: e3bf41bda22c6b68a57b230324f0b4c526bf8b3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1bb4ea1f036397585c411c710cbbf3d5e8abb0f28a00fea02deb0221ebef6ffffbd56edc372022a89e6ea2d07c85a4cd7e319c4b1449325067d787c18d9d9d1
|
7
|
+
data.tar.gz: fbf1c771d30cf3e9a620200acdad87a89ba007e3ea59e38ab65d5d16728eecb63c71edc031919bb2600a5ff60b0345048d2090b53c9f00b9327f0ef926a1f0c4
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
vmesh (0.1.
|
4
|
+
vmesh (0.1.7)
|
5
5
|
gli (= 2.9.0)
|
6
6
|
highline (~> 1.6)
|
7
7
|
logger (= 1.2.8)
|
@@ -29,7 +29,7 @@ GEM
|
|
29
29
|
gherkin (2.12.2)
|
30
30
|
multi_json (~> 1.3)
|
31
31
|
gli (2.9.0)
|
32
|
-
highline (1.
|
32
|
+
highline (1.7.2)
|
33
33
|
json (1.8.1)
|
34
34
|
logger (1.2.8)
|
35
35
|
metaclass (0.0.4)
|
@@ -49,7 +49,7 @@ GEM
|
|
49
49
|
json (~> 1.4)
|
50
50
|
rspec-expectations (2.14.5)
|
51
51
|
diff-lcs (>= 1.1.3, < 2.0)
|
52
|
-
trollop (2.1.
|
52
|
+
trollop (2.1.2)
|
53
53
|
|
54
54
|
PLATFORMS
|
55
55
|
ruby
|
data/bin/vmesh
CHANGED
@@ -1,16 +1,18 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require 'gli'
|
3
|
-
begin # XXX: Remove this begin/rescue before distributing your app
|
3
|
+
#begin # XXX: Remove this begin/rescue before distributing your app
|
4
4
|
require 'vmesh'
|
5
5
|
require 'logger'
|
6
6
|
require 'highline/import'
|
7
7
|
|
8
|
+
=begin
|
8
9
|
rescue LoadError
|
9
10
|
STDERR.puts "In development, you need to use `bundle exec bin/vmesh` to run your app"
|
10
11
|
STDERR.puts "At install-time, RubyGems will make sure lib, etc. are in the load path"
|
11
12
|
STDERR.puts "Feel free to remove this message from bin/vmesh now"
|
12
13
|
exit 64
|
13
14
|
end
|
15
|
+
=end
|
14
16
|
|
15
17
|
include GLI::App
|
16
18
|
|
@@ -33,6 +33,9 @@ command :create do |c|
|
|
33
33
|
Vmesh::template.has_key? vm_type.to_sym or raise "unknown machine type #{vm_type}, known types are #{Vmesh::template.keys.to_s}"
|
34
34
|
|
35
35
|
ip_address = options[:ip_address]
|
36
|
+
if ip_address.to_s != ''
|
37
|
+
raise RuntimeError, "IP Address #{ip_address} already in use" if Vmesh::pingecho(ip_address, 1)
|
38
|
+
end
|
36
39
|
machine_options = {}
|
37
40
|
vm_manager = Vmesh::VSphere.new global_options
|
38
41
|
#default_vm_folder = vm_manager.get_folder(options[:folder]) if options[:folder]
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'socket'
|
2
|
+
require 'timeout'
|
3
|
+
|
4
|
+
module Vmesh
|
5
|
+
def self.pingecho(host, timeout=5, service="echo")
|
6
|
+
begin
|
7
|
+
timeout(timeout) do
|
8
|
+
s = TCPSocket.new(host, service)
|
9
|
+
s.close
|
10
|
+
end
|
11
|
+
rescue Errno::ECONNREFUSED
|
12
|
+
return true
|
13
|
+
rescue Timeout::Error, StandardError
|
14
|
+
return false
|
15
|
+
end
|
16
|
+
return true
|
17
|
+
end
|
18
|
+
end
|
data/lib/vmesh/version.rb
CHANGED
data/lib/vmesh/vsphere.rb
CHANGED
@@ -6,7 +6,7 @@ module Vmesh
|
|
6
6
|
class VSphere
|
7
7
|
attr_accessor :vim, :options
|
8
8
|
def initialize(connection_options)
|
9
|
-
Vmesh::logger.debug "Opening connection to #{connection_options[
|
9
|
+
Vmesh::logger.debug "Opening connection to #{connection_options[:host]} as #{connection_options[:user]}, dc #{connection_options[:datacenter]}, resource pool #{connection_options[:resource_pool]}, insecure #{connection_options[:insecure]}"
|
10
10
|
opts = {
|
11
11
|
:host => connection_options[:host],
|
12
12
|
:user => connection_options[:user],
|
data/lib/vmesh.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vmesh
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kurt Gardiner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -179,6 +179,7 @@ files:
|
|
179
179
|
- lib/vmesh/list.rb
|
180
180
|
- lib/vmesh/logger.rb
|
181
181
|
- lib/vmesh/machine.rb
|
182
|
+
- lib/vmesh/ping_helper.rb
|
182
183
|
- lib/vmesh/server_defaults.rb
|
183
184
|
- lib/vmesh/version.rb
|
184
185
|
- lib/vmesh/vsphere.rb
|