cloudformation-tool 1.5.17 → 1.5.18

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
  SHA256:
3
- metadata.gz: cda5830569bb0452c460ca5751f58071594e3a8752662676364a8c7360035dff
4
- data.tar.gz: 1677f34f4acdc68bf0e7b7870e39f56d8efa351e2d734364ca69ff5c9c74780c
3
+ metadata.gz: c1867f7dfd75baca9665346189538e0e163dc02fed289c86c0bb5cf4f1a4ef0b
4
+ data.tar.gz: 273b829da8d9028c11c4e12a5b62450564390c3dd578e87a38352a4c974f20d8
5
5
  SHA512:
6
- metadata.gz: bd0fc20ae3e89881114581d638b304b137fc9064d362cf6746143df6931db2a91e95898a20ece7061c07ca78d963f279186c1f17012bcef7672612e1b14700bb
7
- data.tar.gz: f22e1e4ffb42bfbfb043625c291ab997b0e8fae5adbffa327160dd4400390837b65e57d57859f6b7c0b849ae3c3a5b9f1873bf99343ae4b90bb66b13d6c6adcd
6
+ metadata.gz: d342f815f27ebdf91df95cb5970ec0a75b37c251e988f0e549d00a25e22028cf1ecd47ed6d9c280511171966cb062d3ac46ebfc7ad8246354a9d3e5a5f25f20c
7
+ data.tar.gz: 25fb6d4fc2fe0309e4aea0503cf01ae2d90e6089d89d273083a91e6282b7dd11a61fd038c8e18d96ed8faf6c033c1fff198a83a45364b577e56da18548261aaa
data/bin/cftool CHANGED
@@ -5,9 +5,9 @@ require 'cloud_formation_tool'
5
5
  begin
6
6
  CloudFormationTool::CLI::Main.run
7
7
  rescue SocketError => e
8
- warn "Networking error: #{e.message}"
8
+ _warn "Networking error: #{e.message}"
9
9
  exit 1
10
10
  rescue CloudFormationTool::Errors::BaseError => e
11
- warn e.message
11
+ _warn e.message
12
12
  exit 1
13
13
  end
@@ -16,8 +16,8 @@ module CloudFormationTool
16
16
  inv.wait
17
17
  log "Invalidation #{inv.id}: #{inv.status}"
18
18
  end
19
- end.each(&:join).length > 0 or error "No valid CloudFront distributions found"
19
+ end.each(&:join).length > 0 or _error "No valid CloudFront distributions found"
20
20
  end
21
21
  end
22
22
  end
23
- end
23
+ end
@@ -16,7 +16,7 @@ module CloudFormationTool
16
16
  sleep 1
17
17
  end
18
18
  rescue CloudFormationTool::Errors::StackDoesNotExistError => e
19
- error "Stack #{stack_name} does not exist"
19
+ _error "Stack #{stack_name} does not exist"
20
20
  rescue SystemExit, Interrupt => e
21
21
  # CTRL-C out of the loop
22
22
  puts "\n"
@@ -25,4 +25,4 @@ module CloudFormationTool
25
25
 
26
26
  end
27
27
  end
28
- end
28
+ end
@@ -31,8 +31,8 @@ module CloudFormationTool
31
31
  puts "#{grp.name}: Left to recycle - #{torecycle}"
32
32
  end
33
33
  end
34
- end.each(&:join).length > 0 or error "No valid Autoscaling groups found named #{asg_name}"
34
+ end.each(&:join).length > 0 or _error "No valid Autoscaling groups found named #{asg_name}"
35
35
  end
36
36
  end
37
37
  end
38
- end
38
+ end
@@ -22,16 +22,16 @@ module CloudFormationTool
22
22
  end
23
23
 
24
24
  def execute
25
- debug "Starting scale operations"
25
+ _debug "Starting scale operations"
26
26
  st = CloudFormation::Stack.new(stack_name)
27
27
  st.asgroups.select do |res|
28
- debug "Checking group #{res.logical_resource_id}"
28
+ _debug "Checking group #{res.logical_resource_id}"
29
29
  asg_name.nil? or (res.logical_resource_id == asg_name)
30
30
  end.collect do |res|
31
- debug "Scaling #{res.logical_resource_id}"
31
+ _debug "Scaling #{res.logical_resource_id}"
32
32
  Thread.new do
33
33
  grp = res.group
34
- debug "Current capacity: #{grp.desired_capacity}, setting to #{scale}"
34
+ _debug "Current capacity: #{grp.desired_capacity}, setting to #{scale}"
35
35
  grp.set_desired_capacity(desired_capacity: scale)
36
36
  last_state = nil
37
37
  until stable_scale(grp, scale)
@@ -9,10 +9,10 @@ module CloudFormationTool
9
9
  if CloudFormation::Stack.new(stack_name).exist?
10
10
  log "OK"
11
11
  else
12
- error "Stack #{stack_name} does not exist"
12
+ _error "Stack #{stack_name} does not exist"
13
13
  end
14
14
  end
15
15
 
16
16
  end
17
17
  end
18
- end
18
+ end
@@ -20,12 +20,12 @@ module CloudFormationTool
20
20
  end
21
21
 
22
22
  def handle_url
23
- debug "Trying Lambda code from #{@data['Url']}"
23
+ _debug "Trying Lambda code from #{@data['Url']}"
24
24
  @data['Url'] = url = @tpl.resolveVal(@data['Url'])
25
25
  return unless url.is_a? String
26
26
  log "Downloading Lambda code from #{url}"
27
27
  if already_in_cache(url)
28
- debug "Reusing remote cached object instead of downloading"
28
+ _debug "Reusing remote cached object instead of downloading"
29
29
  else
30
30
  res = fetch_from_url(url)
31
31
  @s3_url = URI(upload(make_filename(url.split('.').last), res.body, mime_type: res['content-type'], gzip: false))
@@ -36,7 +36,7 @@ module CloudFormationTool
36
36
  def handle_path
37
37
  @data['Path'] = path = @tpl.resolveVal(@data['Path'])
38
38
  return unless path.is_a? String
39
- debug "Reading Lambda code from #{path}"
39
+ _debug "Reading Lambda code from #{path}"
40
40
  path = if path.start_with? "/" then path else "#{@tpl.basedir}/#{path}" end
41
41
  if File.directory?(path)
42
42
  @s3_url = URI(upload(make_filename('zip'), zip_path(path), mime_type: 'application/zip', gzip: false))
@@ -69,7 +69,7 @@ module CloudFormationTool
69
69
  def zip_path(path)
70
70
  Zip::OutputStream.write_buffer do |zf|
71
71
  rdir path do |ent|
72
- debug "Deflating #{ent}"
72
+ _debug "Deflating #{ent}"
73
73
  filepath = File.join(path,ent)
74
74
  zf.put_next_entry ::Zip::Entry.new(nil, ent, nil, nil, nil, nil, nil, nil, ::Zip::DOSTime.at(File.mtime(filepath).to_i))
75
75
  zf.write File.read(filepath)
@@ -93,7 +93,7 @@ module CloudFormationTool
93
93
  break if check_cached(response['ETag']) # dont read the body if its already cached
94
94
  when Net::HTTPRedirection then
95
95
  location = response['location']
96
- debug "Cache check redirected to #{location}"
96
+ _debug "Cache check redirected to #{location}"
97
97
  limit = limit - 1
98
98
  response.body
99
99
  url = URI(location)
@@ -178,4 +178,4 @@ module CloudFormationTool
178
178
  end
179
179
 
180
180
  end
181
- end
181
+ end
@@ -47,10 +47,10 @@ module CloudFormationTool
47
47
  file_opts.delete :acl
48
48
  end
49
49
  file_opts.merge!({content_encoding: 'gzip'}) if gzip
50
- debug "Uploading S3 object s3://#{b.name}/#{o.key}"
50
+ _debug "Uploading S3 object s3://#{b.name}/#{o.key}"
51
51
  o.put(file_opts)
52
52
  else
53
- debug "re-using cached object"
53
+ _debug "re-using cached object"
54
54
  end
55
55
  o.public_url
56
56
  end
@@ -1,3 +1,3 @@
1
1
  module CloudFormationTool
2
- VERSION = '1.5.17'
2
+ VERSION = '1.5.18'
3
3
  end
@@ -15,7 +15,7 @@ def log(message = nil, &block)
15
15
  end)
16
16
  end
17
17
 
18
- def debug(message = nil, &block)
18
+ def _debug(message = nil, &block)
19
19
  logger.debug(if message.nil?
20
20
  yield
21
21
  else
@@ -23,7 +23,7 @@ def debug(message = nil, &block)
23
23
  end)
24
24
  end
25
25
 
26
- def warn(message = nil, &block)
26
+ def _warn(message = nil, &block)
27
27
  logger.warn(if message.nil?
28
28
  yield
29
29
  else
@@ -31,7 +31,7 @@ def warn(message = nil, &block)
31
31
  end)
32
32
  end
33
33
 
34
- def error(message = nil, &block)
34
+ def _error(message = nil, &block)
35
35
  logger.error(if message.nil?
36
36
  yield
37
37
  else
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudformation-tool
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.17
4
+ version: 1.5.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oded Arbel
@@ -10,6 +10,20 @@ bindir: bin
10
10
  cert_chain: []
11
11
  date: 2024-10-08 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: base64
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: rake
15
29
  requirement: !ruby/object:Gem::Requirement