opsicle 2.4.0 → 2.4.1

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: 9e709d4cd1f9b258fae81ec63bbc659c1db1db44
4
- data.tar.gz: 16c3c0ee8f9ac500176497998f551cb885e23d61
3
+ metadata.gz: 1f8bc9ead683ab1997fd4fb96b7f348c67dad1df
4
+ data.tar.gz: f0f6bf0fdc3cd66f04db2dbaa64938393fd4b3db
5
5
  SHA512:
6
- metadata.gz: aeaa6a8211aba81c3d125ab90059493e45df684dd89c31ec62690f3e3a0e037593fa1876160dcfa47b544273079bf86eb3bd5a0e57b2a3a46f6ac1197f4ffe63
7
- data.tar.gz: 1a47aae0831ec1e2a9afa3a44475629eb18b6961660d4ea1bffb73289a28fb4513556a642c41d8d855730b34ea24c7dde85221d90837c34dbe1b82b838b2740e
6
+ metadata.gz: a5ddb67d3098dd6007e5f80900397ffc014c2c9b61aba164c448078300aa2eaf0a64027d6418a51f957919dd022a0631d7c96994bcec67e2ad2026fceaff50ca
7
+ data.tar.gz: eace20aaf2d5bbb4ecffd5e5680b40f886c80d309e9726eb4056416872bf0d1579a7bf5a650e4c29e0650fc66bcd36f96c588a4263694f08901f3bcdae3ad9a3
@@ -132,6 +132,7 @@ module Opsicle
132
132
  agent_version: agent_version,
133
133
  tenancy: self.tenancy,
134
134
  })
135
+ self.layer.add_new_instance(new_instance.instance_id)
135
136
  puts "\nNew instance has been created: #{new_instance.instance_id}"
136
137
  end
137
138
  end
@@ -17,5 +17,10 @@ module Opsicle
17
17
  end
18
18
  self.instances
19
19
  end
20
+
21
+ def add_new_instance(instance_id)
22
+ instance = @opsworks.describe_instances({ :instance_ids => [instance_id] }).instances.first
23
+ self.instances << CloneableInstance.new(instance, self, @opsworks, @cli)
24
+ end
20
25
  end
21
26
  end
@@ -1,3 +1,3 @@
1
1
  module Opsicle
2
- VERSION = "2.4.0"
2
+ VERSION = "2.4.1"
3
3
  end
@@ -20,6 +20,7 @@ module Opsicle
20
20
  allow(@layer).to receive(:ami_id)
21
21
  allow(@layer).to receive(:agent_version=)
22
22
  allow(@layer).to receive(:agent_version)
23
+ allow(@layer).to receive(:add_new_instance)
23
24
  @new_instance = double('new_instance', :instance_id => 1029384756)
24
25
  @opsworks = double('opsworks', :create_instance => @new_instance)
25
26
  @cli = double('cli', :ask => 2)
@@ -39,8 +40,10 @@ module Opsicle
39
40
  instance = CloneableInstance.new(@instance, @layer, @opsworks, @cli)
40
41
  instance1 = double('instance', :hostname => 'example-hostname-01')
41
42
  instance2 = double('instance', :hostname => 'example-hostname-02')
42
- expect(@layer).to receive(:instances).and_return([instance1, instance2])
43
- instance.make_new_hostname('example-hostname-01')
43
+ instance3 = double('instance', :hostname => 'example-hostname-03')
44
+ instance4 = double('instance', :hostname => 'example-hostname-04')
45
+ expect(@layer).to receive(:instances).and_return([instance1, instance2, instance3, instance4])
46
+ expect(instance.make_new_hostname('example-hostname-01')).to eq('example-hostname-05')
44
47
  end
45
48
  end
46
49
 
@@ -24,7 +24,17 @@ module Opsicle
24
24
  :subnet_id => 'subnet_id', :architecture => 'architecture',
25
25
  :root_device_type => 'root_device_type', :install_updates_on_boot => 'install_updates_on_boot',
26
26
  :ebs_optimized => 'ebs_optimized', :tenancy => 'tenancy')
27
+ @instance3 = double('instance3', :hostname => 'example-hostname-03', :status => 'stopped',
28
+ :ami_id => 'ami_id', :instance_type => 'instance_type',
29
+ :agent_version => 'agent_version', :stack_id => 1234567890,
30
+ :layer_ids => [12345, 67890], :auto_scaling_type => 'auto_scaling_type',
31
+ :os => 'os', :ssh_key_name => 'ssh_key_name',
32
+ :availability_zone => 'availability_zone', :virtualization_type => 'virtualization_type',
33
+ :subnet_id => 'subnet_id', :architecture => 'architecture',
34
+ :root_device_type => 'root_device_type', :install_updates_on_boot => 'install_updates_on_boot',
35
+ :ebs_optimized => 'ebs_optimized', :tenancy => 'tenancy')
27
36
  @instances = double('instances', :instances => [@instance1, @instance2])
37
+ @new_instance = double('new_instance', :instances => [@instance3])
28
38
  @opsworks = double('opsworks', :describe_instances => @instances)
29
39
  end
30
40
 
@@ -42,5 +52,21 @@ module Opsicle
42
52
  layer.get_cloneable_instances
43
53
  end
44
54
  end
55
+
56
+ context "#add_new_instance" do
57
+ it "should accurately find a new instance via instance_id" do
58
+ layer = CloneableLayer.new('layer-name', 12345, @opsworks, @cli)
59
+ expect(@opsworks).to receive(:describe_instances).and_return(@new_instance)
60
+ expect(@new_instance).to receive(:instances)
61
+ layer.add_new_instance('456-789')
62
+ end
63
+
64
+ it "should add the new instance to the instances array" do
65
+ layer = CloneableLayer.new('layer-name', 12345, @opsworks, @cli)
66
+ expect(@opsworks).to receive(:describe_instances).and_return(@new_instance)
67
+ expect(CloneableInstance).to receive(:new).once
68
+ layer.add_new_instance('456-789')
69
+ end
70
+ end
45
71
  end
46
72
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opsicle
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Fleener
@@ -9,174 +9,174 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-04-11 00:00:00.000000000 Z
12
+ date: 2017-04-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aws-sdk
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - "~>"
18
+ - - ~>
19
19
  - !ruby/object:Gem::Version
20
20
  version: '2'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - "~>"
25
+ - - ~>
26
26
  - !ruby/object:Gem::Version
27
27
  version: '2'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: gli
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - "~>"
32
+ - - ~>
33
33
  - !ruby/object:Gem::Version
34
34
  version: '2.9'
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - "~>"
39
+ - - ~>
40
40
  - !ruby/object:Gem::Version
41
41
  version: '2.9'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: highline
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - "~>"
46
+ - - ~>
47
47
  - !ruby/object:Gem::Version
48
48
  version: '1.6'
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - "~>"
53
+ - - ~>
54
54
  - !ruby/object:Gem::Version
55
55
  version: '1.6'
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: terminal-table
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
- - - "~>"
60
+ - - ~>
61
61
  - !ruby/object:Gem::Version
62
62
  version: '1.4'
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - "~>"
67
+ - - ~>
68
68
  - !ruby/object:Gem::Version
69
69
  version: '1.4'
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: minitar
72
72
  requirement: !ruby/object:Gem::Requirement
73
73
  requirements:
74
- - - "~>"
74
+ - - ~>
75
75
  - !ruby/object:Gem::Version
76
76
  version: '0.6'
77
77
  type: :runtime
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
- - - "~>"
81
+ - - ~>
82
82
  - !ruby/object:Gem::Version
83
83
  version: '0.6'
84
84
  - !ruby/object:Gem::Dependency
85
85
  name: hashdiff
86
86
  requirement: !ruby/object:Gem::Requirement
87
87
  requirements:
88
- - - "~>"
88
+ - - ~>
89
89
  - !ruby/object:Gem::Version
90
90
  version: '0.2'
91
91
  type: :runtime
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
- - - "~>"
95
+ - - ~>
96
96
  - !ruby/object:Gem::Version
97
97
  version: '0.2'
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: curses
100
100
  requirement: !ruby/object:Gem::Requirement
101
101
  requirements:
102
- - - "~>"
102
+ - - ~>
103
103
  - !ruby/object:Gem::Version
104
104
  version: 1.0.2
105
105
  type: :runtime
106
106
  prerelease: false
107
107
  version_requirements: !ruby/object:Gem::Requirement
108
108
  requirements:
109
- - - "~>"
109
+ - - ~>
110
110
  - !ruby/object:Gem::Version
111
111
  version: 1.0.2
112
112
  - !ruby/object:Gem::Dependency
113
113
  name: bundler
114
114
  requirement: !ruby/object:Gem::Requirement
115
115
  requirements:
116
- - - "~>"
116
+ - - ~>
117
117
  - !ruby/object:Gem::Version
118
118
  version: '1.3'
119
119
  type: :development
120
120
  prerelease: false
121
121
  version_requirements: !ruby/object:Gem::Requirement
122
122
  requirements:
123
- - - "~>"
123
+ - - ~>
124
124
  - !ruby/object:Gem::Version
125
125
  version: '1.3'
126
126
  - !ruby/object:Gem::Dependency
127
127
  name: rake
128
128
  requirement: !ruby/object:Gem::Requirement
129
129
  requirements:
130
- - - "~>"
130
+ - - ~>
131
131
  - !ruby/object:Gem::Version
132
132
  version: '10.1'
133
133
  type: :development
134
134
  prerelease: false
135
135
  version_requirements: !ruby/object:Gem::Requirement
136
136
  requirements:
137
- - - "~>"
137
+ - - ~>
138
138
  - !ruby/object:Gem::Version
139
139
  version: '10.1'
140
140
  - !ruby/object:Gem::Dependency
141
141
  name: rspec
142
142
  requirement: !ruby/object:Gem::Requirement
143
143
  requirements:
144
- - - "~>"
144
+ - - ~>
145
145
  - !ruby/object:Gem::Version
146
146
  version: 3.0.0.beta2
147
147
  type: :development
148
148
  prerelease: false
149
149
  version_requirements: !ruby/object:Gem::Requirement
150
150
  requirements:
151
- - - "~>"
151
+ - - ~>
152
152
  - !ruby/object:Gem::Version
153
153
  version: 3.0.0.beta2
154
154
  - !ruby/object:Gem::Dependency
155
155
  name: guard
156
156
  requirement: !ruby/object:Gem::Requirement
157
157
  requirements:
158
- - - "~>"
158
+ - - ~>
159
159
  - !ruby/object:Gem::Version
160
160
  version: 2.5.0
161
161
  type: :development
162
162
  prerelease: false
163
163
  version_requirements: !ruby/object:Gem::Requirement
164
164
  requirements:
165
- - - "~>"
165
+ - - ~>
166
166
  - !ruby/object:Gem::Version
167
167
  version: 2.5.0
168
168
  - !ruby/object:Gem::Dependency
169
169
  name: guard-rspec
170
170
  requirement: !ruby/object:Gem::Requirement
171
171
  requirements:
172
- - - "~>"
172
+ - - ~>
173
173
  - !ruby/object:Gem::Version
174
174
  version: '4.2'
175
175
  type: :development
176
176
  prerelease: false
177
177
  version_requirements: !ruby/object:Gem::Requirement
178
178
  requirements:
179
- - - "~>"
179
+ - - ~>
180
180
  - !ruby/object:Gem::Version
181
181
  version: '4.2'
182
182
  description: CLI for the opsworks platform
@@ -272,12 +272,12 @@ require_paths:
272
272
  - lib
273
273
  required_ruby_version: !ruby/object:Gem::Requirement
274
274
  requirements:
275
- - - ">="
275
+ - - '>='
276
276
  - !ruby/object:Gem::Version
277
277
  version: '0'
278
278
  required_rubygems_version: !ruby/object:Gem::Requirement
279
279
  requirements:
280
- - - ">="
280
+ - - '>='
281
281
  - !ruby/object:Gem::Version
282
282
  version: '0'
283
283
  requirements: []