opennebula 4.7.80.beta → 4.8.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
  SHA1:
3
- metadata.gz: 94b0a4e8af842368b4a10db1eb29973da9ef60fd
4
- data.tar.gz: 2a601e7dc101041b02e8cd0203acd4f9cecd42fd
3
+ metadata.gz: a6fa857703d3467963c8695ce0b2fa13a395b98b
4
+ data.tar.gz: 1f8e477fd663688db8e3dfc0c42294b2c487a78f
5
5
  SHA512:
6
- metadata.gz: 27e3c88db54a97371e89d48ccfc4f4b6c82edb48dfcc915cf75d74f0c48bd568dd36f7342588fdbe493f885480682391733c54071ecde5567d73366cfc108514
7
- data.tar.gz: 84a799f0f7a394e524dfe52e2c4ab7172bdcd3570cdac35b6c23689af89c81af7d8d86eec5cba85db0b768ca85e4143909f0073db7835810c1adbde2310c51b5
6
+ metadata.gz: ecca11cfc987315d5b9920da0b3149246306e28148ccce3d4dd88d6f711b55cc93f9a025892022ffb756e6e1b1b5ec730a7c1f2cc5e347c46809ccb6fb40a688
7
+ data.tar.gz: 6294197a08dc4c6a1c0951caba175e4daf6d325a7cfd2d9e87c5b00f5335b421c33d81d0cc0c89f6d665695c68fb9fa7b568f44f8bc892455052a9c1695075af
data/lib/opennebula.rb CHANGED
@@ -56,5 +56,5 @@ require 'opennebula/system'
56
56
  module OpenNebula
57
57
 
58
58
  # OpenNebula version
59
- VERSION = '4.7.80'
59
+ VERSION = '4.8.0'
60
60
  end
@@ -113,8 +113,10 @@ module OpenNebula
113
113
  elsif ENV["ONE_AUTH"] and !ENV["ONE_AUTH"].empty? and
114
114
  File.file?(ENV["ONE_AUTH"])
115
115
  @one_auth = File.read(ENV["ONE_AUTH"])
116
- elsif File.file?(ENV["HOME"]+"/.one/one_auth")
116
+ elsif ENV["HOME"] and File.file?(ENV["HOME"]+"/.one/one_auth")
117
117
  @one_auth = File.read(ENV["HOME"]+"/.one/one_auth")
118
+ elsif File.file?("/var/lib/one/.one/one_auth")
119
+ @one_auth = File.read("/var/lib/one/.one/one_auth")
118
120
  else
119
121
  raise "ONE_AUTH file not present"
120
122
  end
@@ -125,8 +127,10 @@ module OpenNebula
125
127
  @one_endpoint = endpoint
126
128
  elsif ENV["ONE_XMLRPC"]
127
129
  @one_endpoint = ENV["ONE_XMLRPC"]
128
- elsif File.exists?(ENV['HOME']+"/.one/one_endpoint")
130
+ elsif ENV['HOME'] and File.exists?(ENV['HOME']+"/.one/one_endpoint")
129
131
  @one_endpoint = File.read(ENV['HOME']+"/.one/one_endpoint")
132
+ elsif File.exists?("/var/lib/one/.one/one_endpoint")
133
+ @one_endpoint = File.read("/var/lib/one/.one/one_endpoint")
130
134
  else
131
135
  @one_endpoint = "http://localhost:2633/RPC2"
132
136
  end
@@ -138,6 +142,7 @@ module OpenNebula
138
142
  http_proxy=options[:http_proxy] if options[:http_proxy]
139
143
 
140
144
  @server = XMLRPC::Client.new2(@one_endpoint, http_proxy, timeout)
145
+ @server.http_header_extra = {'accept-encoding' => 'identity'}
141
146
 
142
147
  if defined?(OxStreamParser)
143
148
  @server.set_parser(OxStreamParser.new)
@@ -197,7 +197,7 @@ module OpenNebula
197
197
 
198
198
  while true
199
199
  a=@client.call("#{@pool_name.delete('_').downcase}.info",
200
- -2, current, -size, -1)
200
+ @user_id, current, -size, -1)
201
201
  return a if OpenNebula.is_error?(a)
202
202
 
203
203
  a_array=parser.parse(a)
@@ -121,6 +121,26 @@ module OpenNebula
121
121
  return rc
122
122
  end
123
123
 
124
+ # Simulates old addleases call
125
+ # @deprecated use {#add_ar}
126
+ def addleases(ip, mac=nil)
127
+ self.info
128
+
129
+ ar_id = self.retrieve_elements("AR_POOL/AR[IP='#{ip}' and SIZE='1']/AR_ID")
130
+
131
+ if !ar_id.nil?
132
+ return Error.new("IP Address Range found with IP #{ip}")
133
+ end
134
+
135
+ template = 'AR = [ '
136
+ template << 'TYPE = "IP4"'
137
+ template << ', IP = "' << ip << '"' if ip
138
+ template << ', MAC = "' << mac << '"' if mac
139
+ template << ', SIZE = 1 ]'
140
+
141
+ add_ar(template)
142
+ end
143
+
124
144
  # Removes an Address Range from the VirtualNetwork
125
145
  def rm_ar(ar_id)
126
146
  return Error.new('ID not defined') if !@pe_id
@@ -131,6 +151,22 @@ module OpenNebula
131
151
  return rc
132
152
  end
133
153
 
154
+ # Simulates old rmleases call
155
+ # @deprecated use #{rm_ar}
156
+ def rmleases(ip)
157
+ self.info
158
+
159
+ ar_id = self.retrieve_elements("AR_POOL/AR[IP='#{ip}' and SIZE='1']/AR_ID")
160
+
161
+ if !ar_id
162
+ Error.new("No single IP Address Range found with IP #{ip}")
163
+ elsif ar_id.size > 1
164
+ Error.new("More than one Address Range found with IP #{ip} use rmar")
165
+ else
166
+ rm_ar(ar_id[0])
167
+ end
168
+ end
169
+
134
170
  # Updates Address Ranges from the VirtualNetwork
135
171
  def update_ar(ar_template)
136
172
  return Error.new('ID not defined') if !@pe_id
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opennebula
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.7.80.beta
4
+ version: 4.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenNebula
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-17 00:00:00.000000000 Z
11
+ date: 2014-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: json
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  description: Libraries needed to talk to OpenNebula
@@ -44,8 +44,6 @@ executables: []
44
44
  extensions: []
45
45
  extra_rdoc_files: []
46
46
  files:
47
- - LICENSE
48
- - NOTICE
49
47
  - lib/opennebula.rb
50
48
  - lib/opennebula/acl.rb
51
49
  - lib/opennebula/acl_pool.rb
@@ -65,14 +63,9 @@ files:
65
63
  - lib/opennebula/host_pool.rb
66
64
  - lib/opennebula/image.rb
67
65
  - lib/opennebula/image_pool.rb
68
- - lib/opennebula/ldap_auth.rb
69
- - lib/opennebula/ldap_auth_spec.rb
70
66
  - lib/opennebula/oneflow_client.rb
71
67
  - lib/opennebula/pool.rb
72
68
  - lib/opennebula/pool_element.rb
73
- - lib/opennebula/server_cipher_auth.rb
74
- - lib/opennebula/server_x509_auth.rb
75
- - lib/opennebula/ssh_auth.rb
76
69
  - lib/opennebula/system.rb
77
70
  - lib/opennebula/template.rb
78
71
  - lib/opennebula/template_pool.rb
@@ -82,12 +75,19 @@ files:
82
75
  - lib/opennebula/virtual_machine_pool.rb
83
76
  - lib/opennebula/virtual_network.rb
84
77
  - lib/opennebula/virtual_network_pool.rb
85
- - lib/opennebula/x509_auth.rb
86
78
  - lib/opennebula/xml_element.rb
87
79
  - lib/opennebula/xml_pool.rb
88
80
  - lib/opennebula/xml_utils.rb
89
81
  - lib/opennebula/zone.rb
90
82
  - lib/opennebula/zone_pool.rb
83
+ - lib/opennebula/ldap_auth.rb
84
+ - lib/opennebula/ldap_auth_spec.rb
85
+ - lib/opennebula/server_cipher_auth.rb
86
+ - lib/opennebula/server_x509_auth.rb
87
+ - lib/opennebula/ssh_auth.rb
88
+ - lib/opennebula/x509_auth.rb
89
+ - NOTICE
90
+ - LICENSE
91
91
  homepage: http://opennebula.org
92
92
  licenses: []
93
93
  metadata: {}
@@ -97,17 +97,17 @@ require_paths:
97
97
  - lib
98
98
  required_ruby_version: !ruby/object:Gem::Requirement
99
99
  requirements:
100
- - - ">="
100
+ - - '>='
101
101
  - !ruby/object:Gem::Version
102
102
  version: '0'
103
103
  required_rubygems_version: !ruby/object:Gem::Requirement
104
104
  requirements:
105
- - - ">"
105
+ - - '>='
106
106
  - !ruby/object:Gem::Version
107
- version: 1.3.1
107
+ version: '0'
108
108
  requirements: []
109
109
  rubyforge_project:
110
- rubygems_version: 2.2.2
110
+ rubygems_version: 2.0.14
111
111
  signing_key:
112
112
  specification_version: 4
113
113
  summary: OpenNebula Client API