cloudformer 0.0.8 → 0.0.9

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: ed4bc831b5b95315110a8674510d4f4952cc6d44
4
- data.tar.gz: df144baf972cc3cbd6b954ec7262d648ce36b3fd
3
+ metadata.gz: 289a320634a41ab510b37f23a1dd7cf4c04b7391
4
+ data.tar.gz: 2df569065ea2baf119783de9acc699142271c434
5
5
  SHA512:
6
- metadata.gz: d1e3d2008848a5da60cfeb1b8836b5f040e88368582ea036420acc7ca36f3390ea3db92d24c93a3de48ea7e0f6cefd68bafa634e9ae9e3e8f989f48d052713c7
7
- data.tar.gz: 516e9d35bc3885f79ccc74e729294a21761f814dc8b940d483dd1c6a0e2ed423863f36c2494d1351e12d126600e5cf308ad8f6e1c344933c15093dc118d8d4ca
6
+ metadata.gz: 6377c44e2e86cd82cf66c1c4add321900ccdba3ed5e0c93d5147f5a00d60688961bc2038812e3e748ece07f2eeef5b29792e4e802ecac1210f4132bcf07f6853
7
+ data.tar.gz: 6eb0794016c19afff9a5e485aa3594114f072723cd2b1ae699f790e11e39caee11ea6ae8ce18b3486830d57d05f706db2584766e87dc3ff6a0f8b02af8d2c88c
@@ -27,7 +27,7 @@ class Stack
27
27
  pending_operations = create(template, parameters, disable_rollback, capabilities)
28
28
  end
29
29
  wait_until_end if pending_operations
30
- if stack.status == "ROLLBACK_COMPLETE"
30
+ if stack.status == "ROLLBACK_COMPLETE" || stack.status == "CREATE_FAILED"
31
31
  puts "Unable to update template. Check log for more information."
32
32
  return 1
33
33
  else
@@ -159,10 +159,14 @@ class Stack
159
159
  puts "Attempting to #{action} all ec2 instances in the stack #{stack.name}"
160
160
  return "Stack not up" if !deployed
161
161
  stack.resources.each do |resource|
162
- next if resource.resource_type != "AWS::EC2::Instance"
163
- physical_resource_id = resource.physical_resource_id
164
- puts "Attempting to #{action} Instance with physical_resource_id: #{physical_resource_id}"
165
- @ec2.instances[physical_resource_id].send(action)
162
+ begin
163
+ next if resource.resource_type != "AWS::EC2::Instance"
164
+ physical_resource_id = resource.physical_resource_id
165
+ puts "Attempting to #{action} Instance with physical_resource_id: #{physical_resource_id}"
166
+ @ec2.instances[physical_resource_id].send(action)
167
+ rescue
168
+ puts "Some resources are not up."
169
+ end
166
170
  end
167
171
  end
168
172
  end
@@ -20,6 +20,7 @@ module Cloudformer
20
20
  define_create_task
21
21
  define_validate_task
22
22
  define_delete_task
23
+ define_delete_with_stop_task
23
24
  define_events_task
24
25
  define_status_task
25
26
  define_outputs_task
@@ -34,7 +35,7 @@ module Cloudformer
34
35
  if retry_delete
35
36
  @stack.delete
36
37
  end
37
- @stack.apply(template, parameters, disable_rollback, capabilities)
38
+ exit @stack.apply(template, parameters, disable_rollback, capabilities)
38
39
  end
39
40
  end
40
41
  def define_delete_task
@@ -47,6 +48,19 @@ module Cloudformer
47
48
  end
48
49
  end
49
50
  end
51
+
52
+ def define_delete_with_stop_task
53
+ desc "Delete stack after stopping all instances"
54
+ task :force_delete do
55
+ begin
56
+ @stack.stop_instances
57
+ @stack.delete
58
+ rescue => e
59
+ puts "Stack delete message - #{e.message}"
60
+ end
61
+ end
62
+ end
63
+
50
64
  def define_status_task
51
65
  desc "Get the deployed app status."
52
66
  task :status do
@@ -1,3 +1,3 @@
1
1
  module Cloudformer
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudformer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arvind Kunday
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-18 00:00:00.000000000 Z
11
+ date: 2013-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler