opendelivery 0.0.14 → 0.0.15

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.
@@ -29,6 +29,12 @@ module OpenDelivery
29
29
  end
30
30
  end
31
31
 
32
+ def load_stack_properties(domain, stack)
33
+ stack.resources.each do |resource|
34
+ set_property(domain, stack.name, resource.resource_type, resource.physical_resource_id)
35
+ end
36
+ end
37
+
32
38
  def get_property(domain, item_name, key)
33
39
  AWS::SimpleDB.consistent_reads do
34
40
  item = @sdb.domains[domain].items[item_name]
@@ -47,22 +47,16 @@ module OpenDelivery
47
47
  end
48
48
 
49
49
 
50
- def create(stack_name, template, parameters = {}, wait=false, domain=nil)
50
+ def create(stack_name, template, parameters = {}, wait?=false, domain=nil)
51
51
  stack = @cfn.stacks.create(stack_name,
52
52
  File.open(template, "r").read,
53
53
  :parameters => parameters,
54
54
  :capabilities => ["CAPABILITY_IAM"],
55
55
  :disable_rollback => true)
56
56
 
57
- if wait
58
- wait_for_stack(stack)
59
- end
57
+ wait_for_stack(stack, wait?)
60
58
 
61
- unless domain.nil?
62
- stack.resources.each do |resource|
63
- @domain.set_property(domain, stack_name, resource.resource_type, resource.physical_resource_id)
64
- end
65
- end
59
+ @domain.load_stack_properties(domain, stack)
66
60
  end
67
61
 
68
62
  def destroy(stack_name, domain=nil, wait=false)
@@ -98,12 +92,14 @@ module OpenDelivery
98
92
 
99
93
  protected
100
94
 
101
- def wait_for_stack(stack)
102
- while stack.status != "CREATE_COMPLETE"
103
- sleep 20
95
+ def wait_for_stack(stack, wait?)
96
+ if wait?
97
+ while stack.status != "CREATE_COMPLETE"
98
+ sleep 20
104
99
 
105
- if FAILURE_STATUSES.include? stack.status
106
- stack.delete
100
+ if FAILURE_STATUSES.include? stack.status
101
+ stack.delete
102
+ end
107
103
  end
108
104
  end
109
105
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opendelivery
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2013-08-31 00:00:00.000000000 Z
14
+ date: 2013-09-04 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rspec