rbovirt 0.1.3 → 0.1.4

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: af1cb013363d659b947761e3e38126834c084042
4
- data.tar.gz: c4ac3c8988f2951bd0eb99e38a5a4db7e219be60
3
+ metadata.gz: b05ea53d2175d3207baf62b7da792bca31ad3c86
4
+ data.tar.gz: 138fccc2e3f1a82ec72b4519a9d6a54d9779eed9
5
5
  SHA512:
6
- metadata.gz: 46c76b24ab5c95762920ddea7c1a44fee65df4fe951b1a4e1fbc9307d3993178e8f7cf87d63c8e87e9ccf8a7da318905a7b8d10ad80c72e0ca754b8d457fb6fd
7
- data.tar.gz: 751efa86aebe75dda8afd43dca666ad23ba1d1958734ff7d9f7715a1c22685ea06387e4f262195d63f02b65ada7b246625099b80c2499656791ec76a4ce04b06
6
+ metadata.gz: fb395d018101fbc35283b930a10393f751a7d360ce333072150dafd5ad06fb087f70ddbfdbc450efed766c5617e68f7c8459add1b9dd280a0e7587fb1143cebc
7
+ data.tar.gz: b9fd797133e7d1bf8a95fd025dcadf86d914b8dda8ba838b5881759496352e9b1798a92322aca6d911f771938b039f8427a452cf3958f564c77e37ec00532c85
@@ -6,6 +6,37 @@ _rbovirt_ project.
6
6
  Note that this list of changes was added with the 0.0.30 release,
7
7
  previous releases aren't described here.
8
8
 
9
+ == 0.1.4
10
+
11
+ New features:
12
+
13
+ * Support passing custom script to start_with_cloudinit
14
+
15
+ Bug fixes:
16
+
17
+ * Support for multi-line runcmd params
18
+ * RBOVIRT_REST_TIMEOUT parse as integer
19
+ * Pin rack to 1.x
20
+ * Blank template does not contain a <cluster> element
21
+
22
+ == 0.1.3
23
+
24
+ New features:
25
+
26
+ * Add instance_type support for VM
27
+ * Add mtu vlan_id and usages to networks
28
+ * Name servers and search domains should be space separated strings
29
+
30
+ Bug fixes:
31
+
32
+ * Name servers and search domains should be passed as space separated strings
33
+
34
+ == 0.1.2
35
+
36
+ Bug fixes:
37
+
38
+ * Explicitly use version 3 of the API
39
+
9
40
  == 0.1.1
10
41
 
11
42
  New features:
data/Gemfile CHANGED
@@ -1,2 +1,4 @@
1
1
  source "http://rubygems.org"
2
+ # rack 2.0 requires ruby 2.2
3
+ gem "rack", "~> 1.6"
2
4
  gemspec
@@ -37,7 +37,9 @@ module OVIRT
37
37
  @status = ((xml/'status').first.text rescue 'unknown')
38
38
  @memory = (xml/'memory').first.text
39
39
  @profile = (xml/'type').first.text
40
- @cluster = Link::new(@client, (xml/'cluster').first[:id], (xml/'cluster').first[:href])
40
+ if (xml/'cluster').first
41
+ @cluster = Link::new(@client, (xml/'cluster').first[:id], (xml/'cluster').first[:href])
42
+ end
41
43
  @display = {
42
44
  :type => ((xml/'display/type').first.text rescue ''),
43
45
  :monitors => ((xml/'display/monitors').first.text rescue 0)
@@ -1,3 +1,3 @@
1
1
  module OVIRT
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
@@ -162,26 +162,23 @@ module OVIRT
162
162
  runcmd = opts[:runcmd]
163
163
  cluster_major, cluster_minor = opts[:cluster_version]
164
164
  api_major,api_minor, api_build, api_revision = opts[:api_version]
165
- extracmd = nil
165
+ extracmd = opts[:custom_script]
166
166
  unless opts[:phone_home].nil?
167
167
  phone_home = \
168
168
  "phone_home:\n" \
169
169
  " url: #{opts[:phone_home]['url']}\n" \
170
170
  " post: #{opts[:phone_home]['post']}\n"
171
- extracmd = phone_home
171
+ extracmd = "#{extracmd}#{phone_home}"
172
172
  end
173
- cmdlist = 'runcmd:'
173
+ cmdlist = 'runcmd:'
174
174
  unless runcmd.nil?
175
175
  runcmd.each do |cmd|
176
176
  cmdlist = \
177
- "#{cmdlist}\n" \
178
- "- #{cmd}\n"
179
- end
180
- if extracmd.nil?
181
- extracmd = cmdlist
182
- else
183
- extracmd = extracmd +cmdlist
177
+ "#{cmdlist}\n" \
178
+ "- |\n"\
179
+ " #{cmd.lines.join(" ")}\n"
184
180
  end
181
+ extracmd = "#{extracmd}#{cmdlist}"
185
182
  end
186
183
  builder = Nokogiri::XML::Builder.new do
187
184
  action {
@@ -204,12 +201,7 @@ module OVIRT
204
201
  end
205
202
  vm {
206
203
  initialization {
207
- unless runcmd.nil?
208
- custom_script cmdlist
209
- end
210
- unless phone_home.nil?
211
- custom_script phone_home
212
- end
204
+ custom_script extracmd if extracmd
213
205
  cloud_init {
214
206
  unless hostname.nil?
215
207
  host { address hostname }
@@ -172,7 +172,7 @@ module OVIRT
172
172
  options[:ssl_cert_store] = ca_cert_store if ca_cert_store
173
173
  options[:ssl_ca_file] = ca_cert_file if ca_cert_file
174
174
  end
175
- options[:timeout] = ENV['RBOVIRT_REST_TIMEOUT'] if ENV['RBOVIRT_REST_TIMEOUT']
175
+ options[:timeout] = ENV['RBOVIRT_REST_TIMEOUT'].to_i if ENV['RBOVIRT_REST_TIMEOUT']
176
176
  RestClient::Resource.new(@api_entrypoint, options)[suburl]
177
177
  end
178
178
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbovirt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amos Benari
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-22 00:00:00.000000000 Z
11
+ date: 2017-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri