opennebula 5.0.0 → 5.0.2
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/lib/cloud/CloudClient.rb +1 -1
- data/lib/opennebula.rb +1 -1
- data/lib/opennebula/datastore.rb +1 -2
- data/lib/opennebula/user_pool.rb +22 -0
- data/lib/opennebula/virtual_machine.rb +1 -0
- data/lib/opennebula/virtual_network.rb +1 -2
- data/lib/vcenter_driver.rb +6 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b3f5a3432e11308e671bec5f860d0ffe8ff9681
|
4
|
+
data.tar.gz: 0cbc97bfb8280440743319d12ef1a2db9a05bd49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ccfbb4c8dfd7d67bfe64e3049b50c2885b193cf74ca6693d618dce9af6632e5d27e5b6f30ad11864bcafb68dcfd9a52d525cfb6ac38146f23a5468271df4f0bd
|
7
|
+
data.tar.gz: d7ef9a12c93613878d1d0f9431ccbeeabdb9d8cf92fe4585b84e1db69c07c08ad1b96e7cd0ff828e77efd62445b6df23096559a25ad2e949562fbca731b92b84
|
data/lib/cloud/CloudClient.rb
CHANGED
data/lib/opennebula.rb
CHANGED
data/lib/opennebula/datastore.rb
CHANGED
@@ -85,8 +85,7 @@ module OpenNebula
|
|
85
85
|
# Allocates a new Datastore in OpenNebula
|
86
86
|
#
|
87
87
|
# @param description [String] The template of the Datastore.
|
88
|
-
# @param cluster_id [Integer] Id of the cluster
|
89
|
-
# this datastore won't be added to any cluster.
|
88
|
+
# @param cluster_id [Integer] Id of the cluster, -1 to use default
|
90
89
|
#
|
91
90
|
# @return [Integer, OpenNebula::Error] the new ID in case of
|
92
91
|
# success, error otherwise
|
data/lib/opennebula/user_pool.rb
CHANGED
@@ -51,5 +51,27 @@ module OpenNebula
|
|
51
51
|
end
|
52
52
|
|
53
53
|
alias_method :info!, :info
|
54
|
+
|
55
|
+
#######################################################################
|
56
|
+
# Helpers to get information
|
57
|
+
#######################################################################
|
58
|
+
|
59
|
+
# Returns a list of user IDs that have the given password. info() needs
|
60
|
+
# to be called before.
|
61
|
+
#
|
62
|
+
# @param driver [String] auth driver to match
|
63
|
+
# @param password [String] password to match
|
64
|
+
# @return [Array] an array of IDs
|
65
|
+
def users_with_password(driver, password)
|
66
|
+
ids = []
|
67
|
+
|
68
|
+
each do |user|
|
69
|
+
if user["PASSWORD"] == password
|
70
|
+
ids << user["ID"]
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
return ids
|
75
|
+
end
|
54
76
|
end
|
55
77
|
end
|
@@ -76,8 +76,7 @@ module OpenNebula
|
|
76
76
|
# Allocates a new VirtualNetwork in OpenNebula
|
77
77
|
#
|
78
78
|
# @param description [String] The template of the VirtualNetwork.
|
79
|
-
# @param cluster_id [Integer] Id of the cluster
|
80
|
-
# this VirtualNetwork won't be added to any cluster.
|
79
|
+
# @param cluster_id [Integer] Id of the cluster, -1 to use default
|
81
80
|
#
|
82
81
|
# @return [Integer, OpenNebula::Error] the new ID in case of
|
83
82
|
# success, error otherwise
|
data/lib/vcenter_driver.rb
CHANGED
@@ -591,6 +591,7 @@ class VIClient
|
|
591
591
|
datastores.each { |ds|
|
592
592
|
next if !ds.is_a? RbVmomi::VIM::Datastore
|
593
593
|
# Find the Cluster from which to access this ds
|
594
|
+
next if !ds.host[0]
|
594
595
|
cluster_name = ds.host[0].key.parent.name
|
595
596
|
|
596
597
|
if !dspool["DATASTORE[NAME=\"#{ds.name}\"]"] and
|
@@ -2003,7 +2004,9 @@ private
|
|
2003
2004
|
# Checks if a RbVmomi::VIM::VirtualDevice is a disk
|
2004
2005
|
########################################################################
|
2005
2006
|
def self.is_disk?(device)
|
2006
|
-
!device.class.ancestors.index(RbVmomi::VIM::VirtualDisk).nil?
|
2007
|
+
is_disk = !(device.class.ancestors.index(RbVmomi::VIM::VirtualDisk)).nil?
|
2008
|
+
is_cdrom = !(device.class.ancestors.index(RbVmomi::VIM::VirtualCdrom)).nil?
|
2009
|
+
is_disk or is_cdrom
|
2007
2010
|
end
|
2008
2011
|
|
2009
2012
|
########################################################################
|
@@ -2437,7 +2440,7 @@ private
|
|
2437
2440
|
img_name = disk.elements["SOURCE"].text
|
2438
2441
|
type_str = disk.elements["TYPE"].text
|
2439
2442
|
|
2440
|
-
disk_array += attach_disk("", "", ds_name, img_name,
|
2443
|
+
disk_array += attach_disk("", "", ds_name, img_name, type_str, 0, vm, connection)[:deviceChange]
|
2441
2444
|
}
|
2442
2445
|
|
2443
2446
|
device_change += disk_array
|
@@ -2647,6 +2650,7 @@ private
|
|
2647
2650
|
ds_and_img_name = "[#{ds_name}] #{img_path}"
|
2648
2651
|
|
2649
2652
|
disk = vm.config.hardware.device.select { |d| is_disk?(d) &&
|
2653
|
+
d.backing.respond_to?(:fileName) &&
|
2650
2654
|
d.backing.fileName == ds_and_img_name }
|
2651
2655
|
|
2652
2656
|
raise "Disk #{img_path} not found." if disk.nil?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opennebula
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OpenNebula
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|