miasma-aws 0.1.36 → 0.2.0

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: aec2838ce61f441e72880ba4b9180373d7097b33
4
- data.tar.gz: 28f051f94c00e72eba5ad5b0e3d802daa8c1e004
3
+ metadata.gz: 577e794142b2f769bbc875247c9d683373c83758
4
+ data.tar.gz: 29f4630085adcb8776924d6a70aa0e10fdc84240
5
5
  SHA512:
6
- metadata.gz: 02a821535e655e5de8cf51bc3881db4b651b2ef9db341e23150ea4dd314b9448059a6dd6696ff2b9a163620c32bcae0aca7cf4b2333281943992edc90c44ab29
7
- data.tar.gz: 8c018c529ed14e5fcffe81a379d7635d28d2871ca94376ee7e0eaa4adb40d223ae92223ba1a6f69673fac796e0c1e2f1fd57925a8ac9dffdaf51dfa3c0012417
6
+ metadata.gz: 0d235ee908d294461f95e4d83ea0c97c9d3839c6c40a48743d79d202eb82e6f338c3401555a3991827eba18c6ca26299200cfef1fad79d7158574df11cc7b5b9
7
+ data.tar.gz: 5784af52e5ecffbb058570e0c6a66525a27ff9a4b5c07f3a0f6113856efcf185c1fea8dc5147bbb354ea90acc40078182b870d562265f4e27d6da8a8d63a6c9d
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ # v0.2.0
2
+ * [enhancement] Properly support miasma abstract specs
3
+ * [fix] Properly handling compute instance naming
4
+ * [fix] Set load balancer as terminated when destroyed
5
+
1
6
  # v0.1.36
2
7
  * Fix access to default headers defined on connection
3
8
 
@@ -1,4 +1,4 @@
1
1
  module MiasmaAws
2
2
  # Current library version
3
- VERSION = Gem::Version.new('0.1.36')
3
+ VERSION = Gem::Version.new('0.2.0')
4
4
  end
@@ -38,7 +38,7 @@ module Miasma
38
38
  srv = result.get(:body, 'DescribeInstancesResponse', 'reservationSet', 'item', 'instancesSet', 'item')
39
39
  server.load_data(
40
40
  :id => srv[:instanceId],
41
- :name => srv.fetch(:tagSet, :item, []).map{|tag| tag[:value] if tag.is_a?(Hash) && tag[:key] == 'Name'}.compact.first,
41
+ :name => [srv.fetch(:tagSet, :item, [])].flatten.map{|tag| tag[:value] if tag.is_a?(Hash) && tag[:key] == 'Name'}.compact.first,
42
42
  :image_id => srv[:imageId],
43
43
  :flavor_id => srv[:instanceType],
44
44
  :state => SERVER_STATE_MAP.fetch(srv.get(:instanceState, :name), :pending),
@@ -81,6 +81,17 @@ module Miasma
81
81
  }
82
82
  )
83
83
  server.id = result.get(:body, 'RunInstancesResponse', 'instancesSet', 'item', 'instanceId')
84
+ server.valid_state
85
+ request(
86
+ :method => :post,
87
+ :path => '/',
88
+ :form => {
89
+ 'Action' => 'CreateTags',
90
+ 'ResourceId.1' => server.id,
91
+ 'Tag.1.Key' => 'Name',
92
+ 'Tag.1.Value' => server.name
93
+ }
94
+ )
84
95
  else
85
96
  raise 'WAT DO I DO!?'
86
97
  end
@@ -92,7 +92,17 @@ module Miasma
92
92
  # @return [Models::LoadBalancer::Balancer]
93
93
  def balancer_reload(balancer)
94
94
  if(balancer.persisted?)
95
- load_balancer_data(balancer)
95
+ begin
96
+ load_balancer_data(balancer)
97
+ rescue Miasma::Error::ApiError::RequestError => e
98
+ if(e.response_error_msg.include?('LoadBalancerNotFound'))
99
+ balancer.state = :terminated
100
+ balancer.status = 'terminated'
101
+ balancer.valid_state
102
+ else
103
+ raise
104
+ end
105
+ end
96
106
  end
97
107
  balancer
98
108
  end
data/miasma-aws.gemspec CHANGED
@@ -10,11 +10,14 @@ Gem::Specification.new do |s|
10
10
  s.description = 'Smoggy AWS API'
11
11
  s.license = 'Apache 2.0'
12
12
  s.require_path = 'lib'
13
- s.add_development_dependency 'miasma', '>= 0.2.29'
13
+ s.add_development_dependency 'miasma', '>= 0.2.35'
14
+ s.add_development_dependency 'rake'
15
+ s.add_development_dependency 'rubocop'
14
16
  s.add_development_dependency 'pry'
15
- s.add_development_dependency 'minitest'
16
17
  s.add_development_dependency 'vcr'
18
+ s.add_development_dependency 'mocha'
17
19
  s.add_development_dependency 'webmock'
18
- s.add_development_dependency 'psych', '>= 2.0.8'
20
+ s.add_development_dependency 'minitest'
21
+ s.add_development_dependency 'minitest-vcr'
19
22
  s.files = Dir['lib/**/*'] + %w(miasma-aws.gemspec README.md CHANGELOG.md LICENSE)
20
23
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: miasma-aws
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.36
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Roberts
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-30 00:00:00.000000000 Z
11
+ date: 2016-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: miasma
@@ -16,16 +16,16 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.2.29
19
+ version: 0.2.35
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 0.2.29
26
+ version: 0.2.35
27
27
  - !ruby/object:Gem::Dependency
28
- name: pry
28
+ name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
@@ -39,7 +39,21 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: minitest
42
+ name: rubocop
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: pry
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
59
  - - ">="
@@ -66,6 +80,20 @@ dependencies:
66
80
  - - ">="
67
81
  - !ruby/object:Gem::Version
68
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: mocha
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
69
97
  - !ruby/object:Gem::Dependency
70
98
  name: webmock
71
99
  requirement: !ruby/object:Gem::Requirement
@@ -81,19 +109,33 @@ dependencies:
81
109
  - !ruby/object:Gem::Version
82
110
  version: '0'
83
111
  - !ruby/object:Gem::Dependency
84
- name: psych
112
+ name: minitest
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: minitest-vcr
85
127
  requirement: !ruby/object:Gem::Requirement
86
128
  requirements:
87
129
  - - ">="
88
130
  - !ruby/object:Gem::Version
89
- version: 2.0.8
131
+ version: '0'
90
132
  type: :development
91
133
  prerelease: false
92
134
  version_requirements: !ruby/object:Gem::Requirement
93
135
  requirements:
94
136
  - - ">="
95
137
  - !ruby/object:Gem::Version
96
- version: 2.0.8
138
+ version: '0'
97
139
  description: Smoggy AWS API
98
140
  email: code@chrisroberts.org
99
141
  executables: []