aebus 0.2.1 → 0.3.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: edc199497096e4bf8425db17d7447df5800f6557
4
- data.tar.gz: b9629b4736feed33598522a002cb746369836bbb
3
+ metadata.gz: d4961058fa793c8cccd9961a3d70f01e0b06436d
4
+ data.tar.gz: 5f9917ee6161fccaec5e1b74a2a71f1bb4308fb7
5
5
  SHA512:
6
- metadata.gz: c569782e3f5193a26b5e947d57c538987ba0f2fee8335f186a2f6bf0a6acec69ef3c57310e47b0379e9842c43b8b3586e58ba941060ef8f68708bd70da2fdefe
7
- data.tar.gz: d9c6988e1a701c459d80e6f2f102f64ca3c22f2f533a7c160ba3da7ecf8668af7b781b04c0b8e99ad5cf4fa304ca7f8bb9925c3cdf8d6044a999ad05c4ac2906
6
+ metadata.gz: 0f331ed5ca55071aa1da176411a3894100ed9c70e9138dedcb1870295fb8ee9a3ded016c08711b351a3271e8e978a5d567d419c71123c8568a03c7ab93d48a41
7
+ data.tar.gz: eca2695285ad5d95c371d11477f0f6a024d43974ff83db64ae6cd8665f2c42b226a98559d2569932c7ee03bb83c4a74b3880bd065bb64157e26f439020b7a532
data/README CHANGED
@@ -12,9 +12,11 @@ A small gem that allows you to easily automate EC2 backups, included purging of
12
12
  backup_time: 00:00:00
13
13
  access_key_id: <your_access_key_id>
14
14
  secret_access_key: <your_secret_access_key>
15
- zone: eu-west1
15
+ region: eu-west1
16
16
  from_address: <your sender address, must be verified with SES>
17
- to_address: <a comma separated list of addresses>
17
+ to_address:
18
+ - address 1
19
+ - address 2
18
20
  backups:
19
21
  daily:
20
22
  enabled: true
@@ -1,27 +1,26 @@
1
1
  # -*- encoding: utf-8 -*-
2
- $:.push File.expand_path("../lib", __FILE__)
3
- require "aebus/version"
2
+ $:.push File.expand_path('../lib', __FILE__)
3
+ require 'aebus/version'
4
4
 
5
5
  Gem::Specification.new do |s|
6
- s.name = "aebus"
6
+ s.name = 'aebus'
7
7
  s.version = Aebus::VERSION
8
8
  s.platform = Gem::Platform::RUBY
9
- s.authors = ["Marco Sandrini"]
10
- s.email = ["nessche@gmail.com"]
11
- s.homepage = "https://github.com/nessche/Aebus"
12
- s.summary = "Automated EC2 BackUp Software"
13
- s.description = "A tool to automate snapshot management in EC2"
14
-
9
+ s.authors = ['Marco Sandrini']
10
+ s.email = ['nessche@gmail.com']
11
+ s.homepage = 'https://github.com/nessche/Aebus'
12
+ s.summary = 'Automated EC2 BackUp Software'
13
+ s.description = 'A tool to automate snapshot management in EC2'
14
+ s.license = 'MIT'
15
15
 
16
16
  s.files = `git ls-files`.split("\n")
17
17
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
18
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
- s.require_paths = ["lib"]
19
+ s.require_paths = ['lib']
20
20
 
21
- s.add_dependency("commander", "~> 4.0.6")
22
- s.add_dependency("parse-cron", ">= 0.1.1")
23
- s.add_dependency("amazon-ec2", "~> 0.9.17")
24
- s.add_dependency("aws-ses", "~> 0.5.0")
21
+ s.add_dependency('commander', '~> 4.4')
22
+ s.add_dependency('parse-cron', '~> 0.1')
23
+ s.add_dependency('aws-sdk', '~> 2')
25
24
 
26
25
  # specify any dependencies here; for example:
27
26
  # s.add_development_dependency "rspec"
data/bin/aebus CHANGED
@@ -6,7 +6,7 @@ require 'pathname'
6
6
  require_relative '../lib/aebus'
7
7
 
8
8
 
9
- DEFAULT_CONFIG_NAME = "./aebus.yaml"
9
+ DEFAULT_CONFIG_NAME = './aebus.yaml'
10
10
 
11
11
  program :version, Aebus::VERSION
12
12
  program :description, 'Automatic EC2 BackUp Software'
@@ -27,12 +27,13 @@ command :status do |c|
27
27
  c.example 'Checks the status of vol1 and vol2', 'aebus status vol1 vol2'
28
28
 
29
29
  c.when_called do |args, options|
30
- options.default \
30
+ options.default(
31
31
  :config => DEFAULT_CONFIG_NAME
32
+ )
32
33
  begin
33
34
  FileTest.exist?(Pathname.new(options.config).realpath)
34
- rescue Errno::ENOENT => e
35
- puts ("Configuration file not found")
35
+ rescue Errno::ENOENT
36
+ puts ('Configuration file not found')
36
37
  exit(2)
37
38
  end
38
39
  aebus = Aebus::Core.new
@@ -53,12 +54,13 @@ command :backup do |c|
53
54
  c.option '--[no-]purge', 'Do not purge expired backups, defaults to --purge'
54
55
  c.option '--[no-]mail', 'Mails a report in case something was done, defaults to --mail'
55
56
  c.when_called do |args, options|
56
- options.default \
57
+ options.default(
57
58
  :config => DEFAULT_CONFIG_NAME,
58
59
  :manual => false,
59
60
  :purge => true,
60
61
  :mail => true
61
- raise ("Config file does not exist") unless FileTest.exist?(Pathname.new(options.config).realpath)
62
+ )
63
+ raise ('Config file does not exist') unless FileTest.exist?(Pathname.new(options.config).realpath)
62
64
  aebus = Aebus::Core.new
63
65
  aebus.backup(args,options)
64
66
  end
@@ -1,13 +1,11 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require 'rubygems'
4
- require 'AWS'
5
- require 'aws/ses'
4
+ require 'aws-sdk'
6
5
  require_relative 'config/config'
7
6
  require_relative 'aebus/version'
8
7
  require_relative 'aebus/logging'
9
8
  require_relative 'aebus/volume_status'
10
- require_relative 'ec2/zones'
11
9
  require_relative 'ec2/snapshot'
12
10
 
13
11
  module Aebus
@@ -16,8 +14,10 @@ module Aebus
16
14
 
17
15
  include Logging
18
16
 
19
- AWS_NAME_TAG = "Name"
20
- AEBUS_TAG = "Aebus"
17
+ AWS_NAME_TAG = 'Name'
18
+ AEBUS_TAG = 'Aebus'
19
+
20
+
21
21
 
22
22
  def status(args, options)
23
23
  @current_time_utc = Time.now.utc
@@ -25,15 +25,19 @@ module Aebus
25
25
  logger.info("status check started at #{@current_time_utc}")
26
26
 
27
27
  @config = Config::Config.new(File.join(File.dirname("."), options.config), @current_time_utc)
28
- @ec2 = AWS::EC2::Base.new(:access_key_id => @config.defaults["access_key_id"],
29
- :secret_access_key => @config.defaults["secret_access_key"],
30
- :server => EC2::zone_to_url(@config.defaults["zone"]))
28
+
29
+ @ec2 = Aws::EC2::Client.new(
30
+ region: @config.defaults['region'],
31
+ credentials: {
32
+ access_key_id: @config.defaults['access_key_id'],
33
+ secret_access_key: @config.defaults['secret_access_key']
34
+ })
31
35
 
32
36
 
33
37
 
34
38
  target_volumes = target_volumes(args)
35
39
 
36
- abort("Configuration contains invalid volumes") unless validate_target_volumes(target_volumes)
40
+ abort('Configuration contains invalid volumes') unless validate_target_volumes(target_volumes)
37
41
 
38
42
  status = check_status(target_volumes)
39
43
 
@@ -100,19 +104,20 @@ module Aebus
100
104
  init_logger options
101
105
  logger.info("backup started at #{@current_time_utc}")
102
106
 
103
- @ec2 = AWS::EC2::Base.new(:access_key_id => @config.defaults["access_key_id"],
104
- :secret_access_key => @config.defaults["secret_access_key"],
105
- :server => EC2::zone_to_url(@config.defaults["zone"]))
107
+ @ec2 = Aws::EC2::Client.new(
108
+ region: @config.defaults['region'],
109
+ credentials: Aws::Credentials.new(@config.defaults['access_key_id'], @config.defaults['secret_access_key'])
110
+ )
106
111
 
107
112
  target_volumes = target_volumes(args)
108
113
 
109
- abort("Configuration contains invalid volumes") unless validate_target_volumes(target_volumes)
114
+ abort('Configuration contains invalid volumes') unless validate_target_volumes(target_volumes)
110
115
 
111
- if (options.manual) then
116
+ if options.manual
112
117
 
113
118
  target_volumes.each do |volume|
114
119
  to_backup += 1
115
- break unless backup_volume(volume, [EC2::AEBUS_MANUAL_TAG])
120
+ break unless backup_volume(volume, [EC2::AEBUS_MANUAL_TAG], @config.get_value_for_volume(volume.id, 'custom_tags'))
116
121
  backed_up += 1
117
122
 
118
123
  end
@@ -131,7 +136,7 @@ module Aebus
131
136
  tags << EC2::AEBUS_AUTO_TAG
132
137
  logger.info("Creating backup for volume #{target} with tags #{tags.join(',')}, max delay #{max_delay}")
133
138
  to_backup +=1
134
- break unless backup_volume(target, tags)
139
+ break unless backup_volume(target, tags, @config.get_value_for_volume(volume.id, 'custom_tags'))
135
140
  backed_up += 1
136
141
  else
137
142
  logger.info("Volume #{target} does not need to be backed up")
@@ -140,7 +145,7 @@ module Aebus
140
145
  end
141
146
 
142
147
  snap_map = get_snapshots_map # we reload the map since we may have created more snapshots
143
- if options.purge then
148
+ if options.purge
144
149
  target_volumes.each do |target|
145
150
  volume = @config.volumes[target]
146
151
  purgeable_snapshot_ids = volume.purgeable_snapshot_ids(snap_map[target])
@@ -151,7 +156,7 @@ module Aebus
151
156
  end
152
157
  end
153
158
  else
154
- logger.info("Skipping purging phase")
159
+ logger.info('Skipping purging phase')
155
160
  end
156
161
 
157
162
  end
@@ -159,7 +164,7 @@ module Aebus
159
164
  message = "Backup Completed at #{Time.now}. Checked #{target_volumes.count} volume(s), #{to_backup} to be backed up, #{backed_up} actually backed up, max delay detected #{max_delay}s, #{to_purge} purgeable snapshot(s), #{purged} purged"
160
165
  logger.info(message)
161
166
  puts(message)
162
- if to_backup > 0 or to_purge > 0 then
167
+ if to_backup > 0 or to_purge > 0
163
168
  send_report message
164
169
  end
165
170
  end
@@ -167,7 +172,7 @@ module Aebus
167
172
  def target_volumes(args)
168
173
 
169
174
  result = @config.volume_ids
170
- if args && (args.count > 0) then
175
+ if args && (args.count > 0)
171
176
  result &= args
172
177
  end
173
178
 
@@ -181,39 +186,56 @@ module Aebus
181
186
 
182
187
  # backs up a given volume using the given time as part of the name and setting the given tags to the snapshot
183
188
  # @param volume_id [String] the id of the volume to be backed up
184
- # @param tags [Array] an array of String to be used as tags for the snapshot
189
+ # @param aebus_tags [Array] an array of String to be used as tags for the snapshot
190
+ # @param custom_tags [Hash] a Hash containing custom tags to be added to the snapshot
185
191
  # @return [boolean] true if the backup was successful, false otherwise
186
- def backup_volume(volume_id, tags)
192
+ def backup_volume(volume_id, aebus_tags, custom_tags = {})
187
193
  begin
188
- volume_info = @ec2.describe_volumes(:volume_id => volume_id)
194
+ volume_info = @ec2.describe_volumes(volume_ids: [volume_id])
189
195
 
190
- rescue AWS::Error => e
196
+ rescue Aws::EC2::Errors::ServiceError => e
191
197
  logger.error("Volume Id #{volume_id} not found. Underlying message #{e.message}")
192
198
  return false
193
199
  end
194
200
 
195
201
  begin
196
- tag_set = volume_info.volumeSet.item[0].tagSet
197
- volume_tags = (tag_set and tag_set.item) ? tag_set.item : []
202
+
203
+ volume_tags = volume_info.volumes[0].tags
198
204
 
199
205
  name_and_desc = Core.name_and_desc(volume_id, volume_tags, @current_time_utc)
200
- create_response = @ec2.create_snapshot(:volume_id => volume_id, :description => name_and_desc[1])
206
+ create_response = @ec2.create_snapshot({volume_id: volume_id, description: name_and_desc[1]})
201
207
 
202
- rescue AWS::Error => e
208
+ rescue Aws::EC2::Errors::ServiceError => e
203
209
  logger.error("Volume Id #{volume_id} could not be backed up. Underlying message #{e.message}")
204
210
  return false
205
211
  end
206
212
 
207
213
  begin
208
214
 
209
- @ec2.create_tags(:resource_id => create_response.snapshotId,
210
- :tag => [{AWS_NAME_TAG => name_and_desc[0]}, {AEBUS_TAG => tags.join(',')}])
211
- rescue AWS::Error => e
212
- logger.error("[WARNING] Could not set tags to snapshot #{create_response.snapshotId}. Underlying message #{e.message}")
215
+ tags = [
216
+ {
217
+ key: AWS_NAME_TAG,
218
+ value: name_and_desc[0]
219
+ },
220
+ {
221
+ key: AEBUS_TAG,
222
+ value: aebus_tags.join(',')
223
+ }
224
+ ]
225
+
226
+ if custom_tags
227
+ custom_tags.each_pair { |k, v| tags << {key: k, value: v} }
228
+ end
229
+
230
+ puts custom_tags
231
+
232
+ @ec2.create_tags(resources: [create_response.snapshot_id], tags: tags)
233
+ rescue Aws::EC2::Errors::ServiceError => e
234
+ logger.error("[WARNING] Could not set tags to snapshot #{create_response.snapshot_id}. Underlying message #{e.message}")
213
235
  return false
214
236
  end
215
237
 
216
- logger.info("Created snapshot #{create_response.snapshotId} for volume #{volume_id}")
238
+ logger.info("Created snapshot #{create_response.snapshot_id} for volume #{volume_id}")
217
239
 
218
240
  true
219
241
 
@@ -226,16 +248,16 @@ module Aebus
226
248
  # @return [Array] an array in the form of [name, description]]
227
249
  def self.name_and_desc(volume_id, tags, utc_time)
228
250
 
229
- name = "backup_#{utc_time.strftime("%Y%m%d")}_#{volume_id}"
251
+ name = "backup_#{utc_time.strftime('%Y%m%d')}_#{volume_id}"
230
252
  volume_name = volume_id
231
253
  tags.each do |tag|
232
- if tag["key"].eql?(AWS_NAME_TAG)
233
- volume_name = tag["value"]
254
+ if tag['key'].eql?(AWS_NAME_TAG)
255
+ volume_name = tag['value']
234
256
  break
235
257
  end
236
258
  end
237
259
 
238
- description = "Backup for volume #{volume_name} taken at #{utc_time.strftime("%Y-%m-%d %H:%M:%S")}"
260
+ description = "Backup for volume #{volume_name} taken at #{utc_time.strftime('%Y-%m-%d %H:%M:%S')}"
239
261
 
240
262
  return [name, description]
241
263
 
@@ -243,9 +265,9 @@ module Aebus
243
265
 
244
266
  def get_snapshots_map
245
267
 
246
- response = @ec2.describe_snapshots(:owner => 'self')
247
- return Hash.new unless response.snapshotSet
248
- snap_array = response.snapshotSet.item
268
+ response = @ec2.describe_snapshots(owner_ids: ['self'])
269
+ return Hash.new unless response.snapshots
270
+ snap_array = response.snapshots
249
271
  result = Hash.new
250
272
  snap_array.each do |snap|
251
273
  snapshot = EC2::Snapshot.new(snap)
@@ -273,7 +295,7 @@ module Aebus
273
295
  else
274
296
  false
275
297
  end
276
- rescue AWS::Error => e
298
+ rescue Aws::EC2::Errors::ServiceError => e
277
299
  logger.warn("Could not purge snapshot #{snapshot_id}; underlying message #{e.message}")
278
300
  false
279
301
  end
@@ -281,11 +303,12 @@ module Aebus
281
303
  end
282
304
 
283
305
  def validate_target_volumes(target_volumes)
306
+ logger.info(target_volumes)
284
307
  begin
285
- @ec2.describe_volumes(:volume_id => target_volumes)
286
- logger.info("Target volumes validated")
308
+ @ec2.describe_volumes({volume_ids: target_volumes})
309
+ logger.info('Target volumes validated')
287
310
  true
288
- rescue AWS::Error => e
311
+ rescue Aws::EC2::Errors::ServiceError => e
289
312
  logger.error("Target validation failed with message '#{e.message}' Check your configuration")
290
313
  false
291
314
  end
@@ -297,21 +320,39 @@ module Aebus
297
320
  logger.warn('Tried to send a message, but no message was specified')
298
321
  return
299
322
  end
300
- to_address = @config.defaults["to_address"]
301
- from_address = @config.defaults["from_address"]
323
+ to_address = @config.defaults['to_address']
324
+ if to_address.instance_of? String
325
+ to_address = [to_address]
326
+ end
327
+ from_address = @config.defaults['from_address']
302
328
  if to_address.nil? or from_address.nil?
303
329
  logger.warn('Tried to send a message but either to or from address where missing from configuration')
304
330
  return
305
331
  end
306
- ses = AWS::SES::Base.new(
307
- :access_key_id => @config.defaults["access_key_id"],
308
- :secret_access_key => @config.defaults["secret_access_key"]
332
+ ses = Aws::SES::Client.new(
333
+ region: @config.defaults['region'],
334
+ credentials: Aws::Credentials.new(@config.defaults['access_key_id'], @config.defaults['secret_access_key'])
309
335
  )
310
336
  logger.info("Sending report to #{to_address} from account #{from_address}")
311
- ses.send_email :to => to_address,
312
- :source => from_address,
313
- :subject => "Aebus Report",
314
- :text_body => message
337
+ ses.send_email({
338
+ destination: {
339
+ to_addresses: to_address
340
+ },
341
+ source: from_address,
342
+ message: {
343
+ subject: {
344
+ charset: 'UTF-8',
345
+ data: 'Aebus Report'
346
+ },
347
+ body: {
348
+ text: {
349
+ charset: 'UTF-8',
350
+ data: message
351
+ }
352
+ }
353
+ }
354
+ })
355
+
315
356
 
316
357
  end
317
358
 
@@ -1,3 +1,3 @@
1
1
  module Aebus
2
- VERSION = '0.2.1'
2
+ VERSION = '0.3.0'
3
3
  end
@@ -15,10 +15,10 @@ module Aebus
15
15
  def initialize(filename, current_time_utc)
16
16
 
17
17
  yaml_root = YAML::load(File.open(filename))
18
- raise "Cannot find configuration file" unless yaml_root
18
+ raise 'Cannot find configuration file' unless yaml_root
19
19
 
20
20
  @defaults = yaml_root.delete(DEFAULT_STRING)
21
- default_backups = BackupSchedule.parse_backups_config(current_time_utc, @defaults["backups"])
21
+ default_backups = BackupSchedule.parse_backups_config(current_time_utc, @defaults['backups'])
22
22
 
23
23
  @volumes = Hash.new
24
24
  yaml_root.each_pair do |k, v|
@@ -40,14 +40,14 @@ module Aebus
40
40
 
41
41
  def get_value_for_volume(volume_id, key)
42
42
  result = nil
43
- if (@volumes.include? volume_id) then
44
- if (@volumes[volume_id].config.include? key) then
43
+ if @volumes.include? volume_id
44
+ if @volumes[volume_id].config.include? key
45
45
  result = @volumes[volume_id].config[key]
46
46
  else
47
47
  result = @defaults[key]
48
48
  end
49
49
  end
50
- result
50
+ result
51
51
  end
52
52
 
53
53
 
@@ -4,7 +4,7 @@ module Aebus
4
4
 
5
5
  module Config
6
6
 
7
- KEEP_ALL = "all"
7
+ KEEP_ALL = 'all'
8
8
 
9
9
  class BackupSchedule
10
10
 
@@ -12,17 +12,17 @@ module Aebus
12
12
 
13
13
  def initialize (current_time_utc, label, backup_config)
14
14
  @label = label
15
- if (backup_config["enabled"]) then
16
- calculate_deadlines(current_time_utc, backup_config["when"])
15
+ if backup_config['enabled']
16
+ calculate_deadlines(current_time_utc, backup_config['when'])
17
17
  end
18
- @keep = backup_config["keep"]
18
+ @keep = backup_config['keep']
19
19
  # we use Infinity to model the keep all
20
20
  @keep = 1.0 / 0 if (@keep.nil? || @keep.eql?(KEEP_ALL))
21
21
 
22
22
  end
23
23
 
24
24
  def calculate_deadlines(current_time_utc, when_string)
25
- raise(ArgumentError, "when field cannot be empty if the backup is enabled") unless when_string
25
+ raise(ArgumentError, 'when field cannot be empty if the backup is enabled') unless when_string
26
26
 
27
27
  parser = CronParser.new (when_string)
28
28
  @last_deadline = parser.last(current_time_utc)
@@ -59,8 +59,8 @@ module Aebus
59
59
  @config = config
60
60
  @id = volume_id
61
61
  @backups = default_backups ? default_backups.dup : Hash.new
62
- if (config && config["backups"]) then
63
- @backups.merge(BackupSchedule.parse_backups_config(current_time_utc,config["backups"]))
62
+ if config && config['backups']
63
+ @backups.merge(BackupSchedule.parse_backups_config(current_time_utc,config['backups']))
64
64
  end
65
65
  end
66
66
 
@@ -83,7 +83,7 @@ module Aebus
83
83
  return false unless snapshots
84
84
  snapshots.each do |snapshot|
85
85
 
86
- if (snapshot.aebus_tags_include?(label) && (snapshot.start_time > last_deadline))
86
+ if snapshot.aebus_tags_include?(label) && (snapshot.start_time > last_deadline)
87
87
  return true
88
88
  end
89
89
 
@@ -98,7 +98,7 @@ module Aebus
98
98
  available_backups = @backups.each_with_object({}) { | (k, v) , h | h[k] = v.keep}
99
99
  removables.each do |snapshot|
100
100
  snapshot.aebus_tags.each do |tag|
101
- if ((available_backups.include? tag) && (available_backups[tag] > 0)) then
101
+ if (available_backups.include? tag) && (available_backups[tag] > 0) then
102
102
  snapshot.keep = true
103
103
  available_backups[tag] -= 1
104
104
  end
@@ -2,10 +2,10 @@ module Aebus
2
2
 
3
3
  module EC2
4
4
 
5
- AEBUS_TAG = "Aebus"
6
- AEBUS_MANUAL_TAG = "manual"
7
- AEBUS_KEEP_TAG = "keep"
8
- AEBUS_AUTO_TAG = "auto"
5
+ AEBUS_TAG = 'Aebus'
6
+ AEBUS_MANUAL_TAG = 'manual'
7
+ AEBUS_KEEP_TAG = 'keep'
8
+ AEBUS_AUTO_TAG = 'auto'
9
9
 
10
10
  class Snapshot
11
11
 
@@ -15,16 +15,16 @@ module Aebus
15
15
 
16
16
  def initialize(hash)
17
17
 
18
- raise(ArgumentError,"hash cannot be nil") unless hash
18
+ raise(ArgumentError, 'hash cannot be nil') unless hash
19
19
  @keep
20
- @id = hash.snapshotId
21
- @start_time = Time.parse(hash.startTime)
22
- @volume_id = hash.volumeId
20
+ @id = hash.snapshot_id
21
+ @start_time = hash.start_time
22
+ @volume_id = hash.volume_id
23
23
  @tags = Hash.new
24
- if (hash.tagSet) then
25
- tag_array = hash.tagSet.item
24
+ if hash.tags
25
+ tag_array = hash.tags
26
26
  tag_array.each do |tag|
27
- @tags.store(tag["key"],tag["value"])
27
+ @tags.store(tag.key,tag.value)
28
28
  end
29
29
  end
30
30
  end
@@ -34,7 +34,7 @@ module Aebus
34
34
  end
35
35
 
36
36
  def aebus_tags_include?(label)
37
- if aebus_snapshot? then
37
+ if aebus_snapshot?
38
38
  return aebus_tags.include? label
39
39
  end
40
40
  false
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aebus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marco Sandrini
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-03 00:00:00.000000000 Z
11
+ date: 2017-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commander
@@ -16,56 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 4.0.6
19
+ version: '4.4'
20
20
  type: :runtime
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: 4.0.6
26
+ version: '4.4'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: parse-cron
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: 0.1.1
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: 0.1.1
41
- - !ruby/object:Gem::Dependency
42
- name: amazon-ec2
43
29
  requirement: !ruby/object:Gem::Requirement
44
30
  requirements:
45
31
  - - "~>"
46
32
  - !ruby/object:Gem::Version
47
- version: 0.9.17
33
+ version: '0.1'
48
34
  type: :runtime
49
35
  prerelease: false
50
36
  version_requirements: !ruby/object:Gem::Requirement
51
37
  requirements:
52
38
  - - "~>"
53
39
  - !ruby/object:Gem::Version
54
- version: 0.9.17
40
+ version: '0.1'
55
41
  - !ruby/object:Gem::Dependency
56
- name: aws-ses
42
+ name: aws-sdk
57
43
  requirement: !ruby/object:Gem::Requirement
58
44
  requirements:
59
45
  - - "~>"
60
46
  - !ruby/object:Gem::Version
61
- version: 0.5.0
47
+ version: '2'
62
48
  type: :runtime
63
49
  prerelease: false
64
50
  version_requirements: !ruby/object:Gem::Requirement
65
51
  requirements:
66
52
  - - "~>"
67
53
  - !ruby/object:Gem::Version
68
- version: 0.5.0
54
+ version: '2'
69
55
  description: A tool to automate snapshot management in EC2
70
56
  email:
71
57
  - nessche@gmail.com
@@ -87,9 +73,9 @@ files:
87
73
  - lib/config/config.rb
88
74
  - lib/config/volume.rb
89
75
  - lib/ec2/snapshot.rb
90
- - lib/ec2/zones.rb
91
76
  homepage: https://github.com/nessche/Aebus
92
- licenses: []
77
+ licenses:
78
+ - MIT
93
79
  metadata: {}
94
80
  post_install_message:
95
81
  rdoc_options: []
@@ -107,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
93
  version: '0'
108
94
  requirements: []
109
95
  rubyforge_project:
110
- rubygems_version: 2.4.5
96
+ rubygems_version: 2.6.10
111
97
  signing_key:
112
98
  specification_version: 4
113
99
  summary: Automated EC2 BackUp Software
@@ -1,19 +0,0 @@
1
- module Aebus
2
-
3
- module EC2
4
-
5
- ZONES = {
6
-
7
- "eu-west1" => "eu-west-1.ec2.amazonaws.com",
8
- "us-east-1" => "ec2.us-east-1.amazonaws.com",
9
- "us-west-1" => "ec2.us-west-1.amazonaws.com",
10
- "ap-southeast-1" => "ec2.ap-southeast-1.amazonaws.com"
11
- }
12
-
13
- def self.zone_to_url(zone)
14
- ZONES[zone]
15
- end
16
-
17
- end
18
-
19
- end