lono 2.0.3 → 2.0.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: f64a82534c16f965a4cb5b2be3bc01953f5a0a2f
4
- data.tar.gz: f2e544a39fed155de259bad986710c7f6ab904b7
3
+ metadata.gz: 8ab0ce183e26fd93e33dac3fc810ecdd793bd1f3
4
+ data.tar.gz: ec9433a8e3fbe00c86463f76305695790e7c3d84
5
5
  SHA512:
6
- metadata.gz: 62ee14f8560a00fd19bb15647ce4cf7b9e945877df19f04d1e62ff919366d1f15b49bb50e73b426cd9d5feef02f90797c3b278df4cd183a7013891e608ba54b4
7
- data.tar.gz: 602efa8bd2060f3779e5c218e2e72e4871dcf9df5fee2157a30af5ddf4330fe32500787fdbda7b34dff36e4d62c968403ba71aef2aef66f60702514878e62824
6
+ metadata.gz: 5b4b9697089c8449295e72dad1e953072c0ea2edf3aff8bd54f7c5898e3bb1121a67d0ff99d52d55bf6e5f423f0a6db7d7e225f077fab4879451d1a2f35fe5a1
7
+ data.tar.gz: 362c8b9f3f4cac0537c48a19cab94b4867b9613245230532a4a2296786a6185b79e4ff12345ba5f3e03ac54a513294a0c4a5ce037287900ded29ad133bf03390
data/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  This project *tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
5
5
 
6
+ ## [2.0.4]
7
+ - cfn preview: exit gracefully when stack doesnt exist
8
+ - exit gracefully with ctrl-c
9
+
6
10
  ## [2.0.3]
7
11
  - fix param generation with cfn preview when stack name is different from param name
8
12
 
data/bin/lono CHANGED
@@ -1,4 +1,10 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
+ # Trap ^C
4
+ Signal.trap("INT") {
5
+ puts "\nCtrl-C detected. Exiting..."
6
+ sleep 1
7
+ exit
8
+ }
3
9
  require_relative "../lib/lono"
4
10
  Lono::CLI.start
data/lib/lono/cfn/diff.rb CHANGED
@@ -2,6 +2,11 @@ class Lono::Cfn::Diff < Lono::Cfn::Base
2
2
  include Lono::Cfn::AwsServices
3
3
 
4
4
  def run
5
+ unless stack_exists?(@stack_name)
6
+ puts "WARN: Cannot create a diff for the stack because the #{@stack_name} does not exists.".colorize(:yellow)
7
+ return
8
+ end
9
+
5
10
  if @options[:noop]
6
11
  puts "NOOP Generating CloudFormation source code diff..."
7
12
  else
@@ -5,20 +5,20 @@ class Lono::Cfn::Preview < Lono::Cfn::Base
5
5
  puts "NOOP CloudFormation preview for #{@stack_name} update"
6
6
  else
7
7
  params = generate_all
8
- preview_change_set(params)
9
- delete_change_set unless @options[:keep] # Clean up and delete the change set
8
+ success = preview_change_set(params)
9
+ delete_change_set if success && !@options[:keep] # Clean up and delete the change set
10
10
  end
11
11
  end
12
12
 
13
13
  def preview_change_set(params)
14
- create_change_set(params)
15
- display_change_set
14
+ success = create_change_set(params)
15
+ display_change_set if success
16
16
  end
17
17
 
18
18
  def create_change_set(params)
19
19
  unless stack_exists?(@stack_name)
20
- puts "Cannot create a change set for the stack because the #{@stack_name} does not exists."
21
- return
20
+ puts "WARN: Cannot create a change set for the stack because the #{@stack_name} does not exists.".colorize(:yellow)
21
+ return false
22
22
  end
23
23
  exist_unless_updatable(stack_status(@stack_name))
24
24
 
@@ -39,6 +39,7 @@ class Lono::Cfn::Preview < Lono::Cfn::Base
39
39
  # raise
40
40
  # end
41
41
  # end
42
+ true
42
43
  end
43
44
 
44
45
  def display_change_set
data/lib/lono/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lono
2
- VERSION = "2.0.3"
2
+ VERSION = "2.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lono
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen