vanagon 0.18.1 → 0.19.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 +4 -4
- data/bin/build +3 -1
- data/bin/build_host_info +3 -1
- data/bin/build_requirements +3 -1
- data/bin/inspect +3 -1
- data/bin/render +3 -1
- data/bin/repo +3 -1
- data/bin/ship +3 -1
- data/bin/sign +3 -1
- data/lib/vanagon/cli.rb +4 -2
- data/lib/vanagon/cli/build.rb +2 -1
- data/lib/vanagon/cli/build_host_info.rb +3 -2
- data/lib/vanagon/cli/build_requirements.rb +4 -4
- data/lib/vanagon/cli/completion.rb +4 -3
- data/lib/vanagon/cli/inspect.rb +3 -2
- data/lib/vanagon/cli/list.rb +5 -6
- data/lib/vanagon/cli/render.rb +2 -1
- data/lib/vanagon/cli/ship.rb +5 -4
- data/lib/vanagon/cli/sign.rb +3 -2
- data/lib/vanagon/component.rb +11 -9
- data/lib/vanagon/component/dsl.rb +6 -5
- data/lib/vanagon/component/source.rb +2 -1
- data/lib/vanagon/component/source/git.rb +7 -6
- data/lib/vanagon/component/source/http.rb +3 -2
- data/lib/vanagon/component/source/local.rb +2 -1
- data/lib/vanagon/component/source/rewrite.rb +3 -2
- data/lib/vanagon/driver.rb +20 -23
- data/lib/vanagon/engine/always_be_scheduling.rb +12 -11
- data/lib/vanagon/engine/docker.rb +2 -1
- data/lib/vanagon/engine/ec2.rb +5 -4
- data/lib/vanagon/engine/hardware.rb +4 -3
- data/lib/vanagon/engine/pooler.rb +6 -5
- data/lib/vanagon/environment.rb +3 -2
- data/lib/vanagon/logger.rb +31 -0
- data/lib/vanagon/platform.rb +6 -5
- data/lib/vanagon/platform/dsl.rb +5 -4
- data/lib/vanagon/platform/windows.rb +3 -1
- data/lib/vanagon/project.rb +20 -14
- data/lib/vanagon/project/dsl.rb +6 -5
- data/lib/vanagon/utilities.rb +5 -4
- data/resources/deb/control.erb +1 -1
- data/resources/osx/postinstall.erb +6 -2
- data/resources/rpm/project.spec.erb +1 -1
- data/resources/solaris/10/depend.erb +2 -2
- data/resources/solaris/10/postinstall.erb +11 -3
- data/resources/solaris/11/p5m.erb +2 -2
- data/spec/lib/vanagon/cli_spec.rb +1 -4
- data/spec/lib/vanagon/component/dsl_spec.rb +9 -2
- data/spec/lib/vanagon/component_spec.rb +3 -2
- data/spec/lib/vanagon/engine/always_be_scheduling_spec.rb +4 -4
- metadata +33 -32
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'vanagon/component'
|
2
|
+
require 'vanagon/logger'
|
2
3
|
require 'vanagon/patch'
|
3
4
|
require 'ostruct'
|
4
5
|
require 'json'
|
@@ -131,8 +132,8 @@ class Vanagon
|
|
131
132
|
# component
|
132
133
|
#
|
133
134
|
# @param requirement [String] a package that is required at runtime for this component
|
134
|
-
def requires(requirement)
|
135
|
-
@component.requires << requirement
|
135
|
+
def requires(requirement, version = nil)
|
136
|
+
@component.requires << OpenStruct.new(:requirement => requirement, :version => version)
|
136
137
|
end
|
137
138
|
|
138
139
|
# Indicates that this component replaces a system level package. Replaces can be collected and used by the project and package.
|
@@ -237,7 +238,7 @@ class Vanagon
|
|
237
238
|
|
238
239
|
if @component.platform.is_windows?
|
239
240
|
unless mode.nil? && owner.nil? && group.nil?
|
240
|
-
|
241
|
+
VanagonLogger.info "You're trying to set the mode, owner, or group for windows. I don't know how to do that, ignoring!"
|
241
242
|
end
|
242
243
|
else
|
243
244
|
mode ||= '0644'
|
@@ -407,7 +408,7 @@ class Vanagon
|
|
407
408
|
install_flags = ['-d']
|
408
409
|
if @component.platform.is_windows?
|
409
410
|
unless mode.nil? && owner.nil? && group.nil?
|
410
|
-
|
411
|
+
VanagonLogger.info "You're trying to set the mode, owner, or group for windows. I don't know how to do that, ignoring!"
|
411
412
|
end
|
412
413
|
else
|
413
414
|
install_flags << "-m '#{mode}'" unless mode.nil?
|
@@ -422,7 +423,7 @@ class Vanagon
|
|
422
423
|
# @param env [Hash] mapping of keys to values to add to the environment for the component
|
423
424
|
def environment(*env)
|
424
425
|
if env.size == 1 && env.first.is_a?(Hash)
|
425
|
-
|
426
|
+
VanagonLogger.info <<-WARNING.undent
|
426
427
|
the component DSL method signature #environment({Key => Value}) is deprecated
|
427
428
|
and will be removed by Vanagon 1.0.0.
|
428
429
|
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'fustigit'
|
2
|
+
require 'vanagon/logger'
|
2
3
|
require 'vanagon/component/source/http'
|
3
4
|
require 'vanagon/component/source/git'
|
4
5
|
require 'vanagon/component/source/local'
|
@@ -66,7 +67,7 @@ class Vanagon
|
|
66
67
|
timeout = 5
|
67
68
|
if Vanagon::Component::Source::Git.valid_remote?(uri, timeout)
|
68
69
|
if uri =~ /^http/
|
69
|
-
|
70
|
+
VanagonLogger.info "Passing git URLs as http(s) addresses is deprecated! Please prefix your source URL with `git:`"
|
70
71
|
end
|
71
72
|
return :git
|
72
73
|
end
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'vanagon/utilities'
|
2
2
|
require 'vanagon/errors'
|
3
|
+
require 'vanagon/logger'
|
3
4
|
# This stupid library requires a capital 'E' in its name
|
4
5
|
# but it provides a wealth of useful constants
|
5
6
|
require 'English'
|
@@ -81,7 +82,7 @@ class Vanagon
|
|
81
82
|
# There is no md5 to manually verify here, so this is a noop.
|
82
83
|
def verify
|
83
84
|
# nothing to do here, so just tell users that and return
|
84
|
-
|
85
|
+
VanagonLogger.info "Nothing to verify for '#{dirname}' (using Git reference '#{ref}')"
|
85
86
|
end
|
86
87
|
|
87
88
|
# The dirname to reference when building from the repo
|
@@ -131,8 +132,8 @@ class Vanagon
|
|
131
132
|
# Clone a remote repo, make noise about it, and fail entirely
|
132
133
|
# if we're unable to retrieve the remote repo
|
133
134
|
def clone!
|
134
|
-
|
135
|
-
|
135
|
+
VanagonLogger.info "Cloning Git repo '#{url}'"
|
136
|
+
VanagonLogger.info "Successfully cloned '#{dirname}'" if clone
|
136
137
|
rescue ::Git::GitExecuteError
|
137
138
|
raise Vanagon::InvalidRepo, "Unable to clone from '#{url}'"
|
138
139
|
end
|
@@ -141,7 +142,7 @@ class Vanagon
|
|
141
142
|
# Checkout desired ref/sha, make noise about it, and fail
|
142
143
|
# entirely if we're unable to checkout that given ref/sha
|
143
144
|
def checkout!
|
144
|
-
|
145
|
+
VanagonLogger.info "Checking out '#{ref}' from Git repo '#{dirname}'"
|
145
146
|
clone.checkout(ref)
|
146
147
|
rescue ::Git::GitExecuteError
|
147
148
|
raise Vanagon::CheckoutFailed, "unable to checkout #{ref} from '#{url}'"
|
@@ -151,7 +152,7 @@ class Vanagon
|
|
151
152
|
# Attempt to update submodules, and do not panic
|
152
153
|
# if there are no submodules to initialize
|
153
154
|
def update_submodules
|
154
|
-
|
155
|
+
VanagonLogger.info "Attempting to update submodules for repo '#{dirname}'"
|
155
156
|
clone.update_submodules(init: true)
|
156
157
|
end
|
157
158
|
private :update_submodules
|
@@ -163,7 +164,7 @@ class Vanagon
|
|
163
164
|
def describe
|
164
165
|
clone.describe(ref, tags: true)
|
165
166
|
rescue ::Git::GitExecuteError
|
166
|
-
|
167
|
+
VanagonLogger.info "Directory '#{dirname}' cannot be versioned by Git. Maybe it hasn't been tagged yet?"
|
167
168
|
end
|
168
169
|
private :describe
|
169
170
|
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'vanagon/utilities'
|
2
|
+
require 'vanagon/logger'
|
2
3
|
require 'vanagon/component/source/local'
|
3
4
|
require 'net/http'
|
4
5
|
require 'uri'
|
@@ -93,7 +94,7 @@ class Vanagon
|
|
93
94
|
#
|
94
95
|
# @raise [RuntimeError] an exception is raised if the sum does not match the sum of the file
|
95
96
|
def verify # rubocop:disable Metrics/AbcSize
|
96
|
-
|
97
|
+
VanagonLogger.info "Verifying file: #{file} against sum: '#{sum}'"
|
97
98
|
actual = get_sum(File.join(workdir, file), sum_type)
|
98
99
|
return true if sum == actual
|
99
100
|
|
@@ -107,7 +108,7 @@ class Vanagon
|
|
107
108
|
uri = URI.parse(target_url.to_s)
|
108
109
|
target_file ||= File.basename(uri.path)
|
109
110
|
|
110
|
-
|
111
|
+
VanagonLogger.info "Downloading file '#{target_file}' from url '#{target_url}'"
|
111
112
|
|
112
113
|
Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == 'https') do |http|
|
113
114
|
http.request(Net::HTTP::Get.new(uri, headers)) do |response|
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'vanagon/utilities'
|
2
|
+
require 'vanagon/logger'
|
2
3
|
|
3
4
|
class Vanagon
|
4
5
|
class Component
|
@@ -57,7 +58,7 @@ class Vanagon
|
|
57
58
|
#
|
58
59
|
# @raise [RuntimeError, Vanagon::Error] an exception is raised if the URI scheme cannot be handled
|
59
60
|
def copy
|
60
|
-
|
61
|
+
VanagonLogger.info "Copying file '#{url.basename}' to workdir"
|
61
62
|
|
62
63
|
FileUtils.cp_r(url, file)
|
63
64
|
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'vanagon/component/source'
|
2
|
+
require 'vanagon/logger'
|
2
3
|
|
3
4
|
class Vanagon
|
4
5
|
class Component
|
@@ -16,7 +17,7 @@ class Vanagon
|
|
16
17
|
# @deprecated Please use the component DSL method #mirror(<URI>)
|
17
18
|
# instead. This method will be removed before Vanagon 1.0.0.
|
18
19
|
def register_rewrite_rule(protocol, rule)
|
19
|
-
|
20
|
+
VanagonLogger.info <<-HERE.undent
|
20
21
|
rewrite rule support is deprecated and will be removed before Vanagon 1.0.0.
|
21
22
|
Rewritten URLs will be automatically converted into mirror URLs for now but
|
22
23
|
please use the component DSL method '#mirror url' to define new mirror URL
|
@@ -76,7 +77,7 @@ class Vanagon
|
|
76
77
|
def parse_and_rewrite(uri)
|
77
78
|
return uri if rewrite_rules.empty?
|
78
79
|
if !!uri.match(/^git:http/)
|
79
|
-
|
80
|
+
VanagonLogger.info <<-HERE.undent
|
80
81
|
`fustigit` parsing doesn't get along with how we specify the source
|
81
82
|
type by prefixing `git`. As `rewrite_rules` are deprecated, we'll
|
82
83
|
replace `git:http` with `http` in your uri. At some point this will
|
data/lib/vanagon/driver.rb
CHANGED
@@ -4,6 +4,7 @@ require 'vanagon/component'
|
|
4
4
|
require 'vanagon/utilities'
|
5
5
|
require 'vanagon/common'
|
6
6
|
require 'vanagon/errors'
|
7
|
+
require 'vanagon/logger'
|
7
8
|
require 'tmpdir'
|
8
9
|
require 'logger'
|
9
10
|
|
@@ -50,32 +51,28 @@ class Vanagon
|
|
50
51
|
# flatten all the results in to one array and set project.components to that.
|
51
52
|
@project.components = only_build.flat_map { |comp| @project.filter_component(comp) }.uniq
|
52
53
|
if @verbose
|
53
|
-
|
54
|
-
@project.components.each { |comp|
|
54
|
+
VanagonLogger.info "Only building:"
|
55
|
+
@project.components.each { |comp| VanagonLogger.info comp.name }
|
55
56
|
end
|
56
57
|
end
|
57
58
|
|
58
59
|
def pick_engine(options) # rubocop:disable Metrics/PerceivedComplexity
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
return default_engine
|
60
|
+
if options[:engine] && !options[:target]
|
61
|
+
options[:engine]
|
62
|
+
elsif @platform.build_hosts
|
63
|
+
'hardware'
|
64
|
+
elsif @platform.aws_ami
|
65
|
+
'ec2'
|
66
|
+
elsif @platform.docker_image
|
67
|
+
'docker'
|
68
|
+
elsif options[:target]
|
69
|
+
'base'
|
70
|
+
else
|
71
|
+
'always_be_scheduling'
|
72
|
+
end
|
74
73
|
end
|
75
74
|
|
76
75
|
def load_engine_object(engine_type, platform, target)
|
77
|
-
engine_type = 'base' if target
|
78
|
-
|
79
76
|
require "vanagon/engine/#{engine_type}"
|
80
77
|
@engine = Object::const_get("Vanagon::Engine::#{camelize(engine_type)}")
|
81
78
|
.new(platform, target, remote_workdir: remote_workdir)
|
@@ -138,7 +135,7 @@ class Vanagon
|
|
138
135
|
end
|
139
136
|
|
140
137
|
@engine.startup(workdir)
|
141
|
-
|
138
|
+
VanagonLogger.info "Target is #{@engine.target}"
|
142
139
|
Vanagon::Utilities.retry_with_timeout(retry_count, timeout) do
|
143
140
|
install_build_dependencies
|
144
141
|
end
|
@@ -163,8 +160,8 @@ class Vanagon
|
|
163
160
|
@engine.teardown
|
164
161
|
cleanup_workdir
|
165
162
|
end
|
166
|
-
|
167
|
-
|
163
|
+
VanagonLogger.error(e)
|
164
|
+
VanagonLogger.error e.backtrace.join("\n")
|
168
165
|
raise e
|
169
166
|
ensure
|
170
167
|
if ["hardware", "ec2"].include?(@engine.name)
|
@@ -178,7 +175,7 @@ class Vanagon
|
|
178
175
|
raise Vanagon::Error, "Project requires a version set, all is lost."
|
179
176
|
end
|
180
177
|
|
181
|
-
|
178
|
+
VanagonLogger.info "rendering Makefile"
|
182
179
|
@project.fetch_sources(workdir, retry_count, timeout)
|
183
180
|
@project.make_bill_of_materials(workdir)
|
184
181
|
@project.generate_packaging_artifacts(workdir)
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'json'
|
2
2
|
require 'vanagon/engine/base'
|
3
|
+
require 'vanagon/logger'
|
3
4
|
require 'yaml'
|
4
5
|
|
5
6
|
class Vanagon
|
@@ -141,14 +142,14 @@ class Vanagon
|
|
141
142
|
absolute_path = File.expand_path(path)
|
142
143
|
return nil unless File.exist?(absolute_path)
|
143
144
|
|
144
|
-
|
145
|
+
VanagonLogger.info "Reading ABS token from: #{path}"
|
145
146
|
contents = File.read(absolute_path).chomp
|
146
147
|
lines = contents.each_line.map(&:chomp)
|
147
148
|
|
148
149
|
abs = lines.shift
|
149
150
|
@token_vmpooler = lines.shift
|
150
151
|
|
151
|
-
|
152
|
+
VanagonLogger.info "Please add a second line with the vmpooler token to be able to modify or see the VM in floaty/bit-bar" if @token_vmpooler.nil?
|
152
153
|
return abs
|
153
154
|
end
|
154
155
|
private :read_vanagon_token
|
@@ -217,7 +218,7 @@ class Vanagon
|
|
217
218
|
message.concat(" with a vmpooler_fallback token")
|
218
219
|
end
|
219
220
|
end
|
220
|
-
|
221
|
+
VanagonLogger.info message
|
221
222
|
return abs_token
|
222
223
|
end
|
223
224
|
private :read_vmfloaty_token
|
@@ -235,7 +236,7 @@ class Vanagon
|
|
235
236
|
def select_target_from(pooler) # rubocop:disable Metrics/AbcSize
|
236
237
|
request_object = build_request_object
|
237
238
|
|
238
|
-
|
239
|
+
VanagonLogger.info "Requesting VMs with job_id: #{@saved_job_id}. Will poll for up to an hour."
|
239
240
|
#the initial request is always replied with "come back again"
|
240
241
|
response = Vanagon::Utilities.http_request_generic(
|
241
242
|
"#{pooler}/request",
|
@@ -245,10 +246,10 @@ class Vanagon
|
|
245
246
|
)
|
246
247
|
|
247
248
|
unless response.code == "202"
|
248
|
-
|
249
|
+
VanagonLogger.info "failed to request ABS with code #{response.code}"
|
249
250
|
if valid_json?(response.body)
|
250
251
|
response_json = JSON.parse(response.body)
|
251
|
-
|
252
|
+
VanagonLogger.info "reason: #{response_json['reason']}"
|
252
253
|
end
|
253
254
|
return ''
|
254
255
|
end
|
@@ -278,12 +279,12 @@ class Vanagon
|
|
278
279
|
|
279
280
|
sleep_seconds = 10 if i >= 10
|
280
281
|
sleep_seconds = i if i < 10
|
281
|
-
|
282
|
+
VanagonLogger.info "Waiting #{sleep_seconds} seconds to check if ABS request has been filled. (x#{i})"
|
282
283
|
|
283
284
|
sleep(sleep_seconds)
|
284
285
|
end
|
285
286
|
rescue SystemExit, Interrupt
|
286
|
-
|
287
|
+
VanagonLogger.error "\nVanagon interrupted during mains ABS polling. Make sure you delete the requested job_id #{@saved_job_id}"
|
287
288
|
raise
|
288
289
|
end
|
289
290
|
response_body = translated(response_body, @saved_job_id)
|
@@ -321,14 +322,14 @@ class Vanagon
|
|
321
322
|
)
|
322
323
|
if response && response.body == 'OK'
|
323
324
|
Vanagon::Driver.logger.info "#{@saved_job_id} has been scheduled for removal"
|
324
|
-
|
325
|
+
VanagonLogger.info "#{@saved_job_id} has been scheduled for removal"
|
325
326
|
else
|
326
327
|
Vanagon::Driver.logger.info "#{@saved_job_id} could not be scheduled for removal: #{response.body}"
|
327
|
-
|
328
|
+
VanagonLogger.info "#{@saved_job_id} could not be scheduled for removal"
|
328
329
|
end
|
329
330
|
rescue Vanagon::Error => e
|
330
331
|
Vanagon::Driver.logger.info "#{@saved_job_id} could not be scheduled for removal (#{e.message})"
|
331
|
-
|
332
|
+
VanagonLogger.info "#{@saved_job_id} could not be scheduled for removal (#{e.message})"
|
332
333
|
end
|
333
334
|
|
334
335
|
private
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'vanagon/engine/base'
|
2
|
+
require 'vanagon/logger'
|
2
3
|
|
3
4
|
class Vanagon
|
4
5
|
class Engine
|
@@ -52,7 +53,7 @@ class Vanagon
|
|
52
53
|
Vanagon::Utilities.ex("#{@docker_cmd} stop #{build_host_name}-builder")
|
53
54
|
Vanagon::Utilities.ex("#{@docker_cmd} rm #{build_host_name}-builder")
|
54
55
|
rescue Vanagon::Error => e
|
55
|
-
|
56
|
+
VanagonLogger.error "There was a problem tearing down the docker container #{build_host_name}-builder (#{e.message})."
|
56
57
|
end
|
57
58
|
|
58
59
|
def dispatch(command, return_output = false)
|
data/lib/vanagon/engine/ec2.rb
CHANGED
@@ -2,6 +2,7 @@ require 'aws-sdk'
|
|
2
2
|
require 'erb'
|
3
3
|
require 'base64'
|
4
4
|
require 'vanagon/engine/base'
|
5
|
+
require 'vanagon/logger'
|
5
6
|
|
6
7
|
class Vanagon
|
7
8
|
class Engine
|
@@ -57,17 +58,17 @@ class Vanagon
|
|
57
58
|
end
|
58
59
|
|
59
60
|
def select_target
|
60
|
-
|
61
|
-
|
61
|
+
VanagonLogger.info "Instance created id: #{instance.id}"
|
62
|
+
VanagonLogger.info "Created instance waiting for status ok"
|
62
63
|
@ec2.wait_until(:instance_status_ok, instance_ids: [instance.id])
|
63
|
-
|
64
|
+
VanagonLogger.info "Instance running"
|
64
65
|
@target = instance.private_ip_address
|
65
66
|
rescue ::Aws::Waiters::Errors::WaiterFailed => error
|
66
67
|
fail "Failed to wait for ec2 instance to start got error #{error}"
|
67
68
|
end
|
68
69
|
|
69
70
|
def teardown
|
70
|
-
|
71
|
+
VanagonLogger.info "Destroying instance on AWS id: #{instance.id}"
|
71
72
|
instances.batch_terminate!
|
72
73
|
end
|
73
74
|
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'vanagon/engine/base'
|
2
|
+
require 'vanagon/logger'
|
2
3
|
require 'json'
|
3
4
|
require 'lock_manager'
|
4
5
|
|
@@ -23,7 +24,7 @@ class Vanagon
|
|
23
24
|
Vanagon::Driver.logger.info "Polling for a lock on #{host}."
|
24
25
|
@lockman.polling_lock(host, VANAGON_LOCK_USER, "Vanagon automated lock")
|
25
26
|
Vanagon::Driver.logger.info "Lock acquired on #{host}."
|
26
|
-
|
27
|
+
VanagonLogger.info "Lock acquired on #{host} for #{VANAGON_LOCK_USER}."
|
27
28
|
host
|
28
29
|
end
|
29
30
|
|
@@ -33,7 +34,7 @@ class Vanagon
|
|
33
34
|
Vanagon::Driver.logger.info "Attempting to lock #{h}."
|
34
35
|
if @lockman.lock(h, VANAGON_LOCK_USER, "Vanagon automated lock")
|
35
36
|
Vanagon::Driver.logger.info "Lock acquired on #{h}."
|
36
|
-
|
37
|
+
VanagonLogger.info "Lock acquired on #{h} for #{VANAGON_LOCK_USER}."
|
37
38
|
return h
|
38
39
|
end
|
39
40
|
end
|
@@ -45,7 +46,7 @@ class Vanagon
|
|
45
46
|
# complete. In this case, we'll attempt to unlock the hardware
|
46
47
|
def teardown
|
47
48
|
Vanagon::Driver.logger.info "Removing lock on #{@target}."
|
48
|
-
|
49
|
+
VanagonLogger.info "Removing lock on #{@target}."
|
49
50
|
@lockman.unlock(@target, VANAGON_LOCK_USER)
|
50
51
|
end
|
51
52
|
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'vanagon/engine/base'
|
2
|
+
require 'vanagon/logger'
|
2
3
|
require 'yaml'
|
3
4
|
|
4
5
|
### Note this class is deprecated in favor of using the ABS Engine. The pooler has changed it's API with regards to
|
@@ -60,7 +61,7 @@ class Vanagon
|
|
60
61
|
absolute_path = File.expand_path(path)
|
61
62
|
return nil unless File.exist?(absolute_path)
|
62
63
|
|
63
|
-
|
64
|
+
VanagonLogger.info "Reading vmpooler token from: #{path}"
|
64
65
|
File.read(absolute_path).chomp
|
65
66
|
end
|
66
67
|
private :read_vanagon_token
|
@@ -74,7 +75,7 @@ class Vanagon
|
|
74
75
|
absolute_path = File.expand_path(path)
|
75
76
|
return nil unless File.exist?(absolute_path)
|
76
77
|
|
77
|
-
|
78
|
+
VanagonLogger.info "Reading vmpooler token from: #{path}"
|
78
79
|
YAML.load_file(absolute_path)['token']
|
79
80
|
end
|
80
81
|
private :read_vmfloaty_token
|
@@ -145,14 +146,14 @@ class Vanagon
|
|
145
146
|
)
|
146
147
|
if response and response["ok"]
|
147
148
|
Vanagon::Driver.logger.info "#{@target} has been destroyed"
|
148
|
-
|
149
|
+
VanagonLogger.info "#{@target} has been destroyed"
|
149
150
|
else
|
150
151
|
Vanagon::Driver.logger.info "#{@target} could not be destroyed"
|
151
|
-
|
152
|
+
VanagonLogger.info "#{@target} could not be destroyed"
|
152
153
|
end
|
153
154
|
rescue Vanagon::Error => e
|
154
155
|
Vanagon::Driver.logger.info "#{@target} could not be destroyed (#{e.message})"
|
155
|
-
|
156
|
+
VanagonLogger.error "#{@target} could not be destroyed (#{e.message})"
|
156
157
|
end
|
157
158
|
end
|
158
159
|
end
|