automan 2.4.0 → 2.4.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 556e8ef30f82380e1d0aa07bf033feb1dd2bf574
4
- data.tar.gz: cf5aea391bdafeb455f5c9e9b0084797fced6881
3
+ metadata.gz: 2bf6f3ba54e3992bdfb73a8151cc31ec35e2f00b
4
+ data.tar.gz: fb0621083299dfbf474aa90e4ba46a520432edbb
5
5
  SHA512:
6
- metadata.gz: 9cac1683af9f00f2215e4430bc3787b1ada1f86d23a6de920b7e55cc800de2383aa7d8bbe4ab198474f134b79fdf5df006c88e8f8cb711f4f9d1cd4570379984
7
- data.tar.gz: 90f61b9c7ccc3f75250e9c2c1efea0f405c31027ed9ae5c18aa6d42414a85cba396650d40630de830d6fe81299a5b97cdcce9e0fa9e03556be164c9365d3dcb3
6
+ metadata.gz: 9dd3e1c72155f318cec831c661dbf07ff73cd464f2f617157e799e1ed0e4c697dee44787b9e9f6a166f95cf4f024f9c57f57acf2d6deff966bb38a1b7caa24b6
7
+ data.tar.gz: 15b0e024fe045714e812d6fadf05d6c1caa773a44ab380ba14ff9a25deb91aee4860e0500b6cac8d1a5008ba6407586f89bee2691b09cdf07e9f7a4dea8568d7
@@ -33,6 +33,12 @@ module Automan::Cli
33
33
  desc: "Maximum number of snapshots of this type to retain",
34
34
  type: :numeric
35
35
 
36
+ option :quiet,
37
+ aliases: "-q",
38
+ desc: "Quiet mode: exit 0 when database does not exist",
39
+ type: :boolean,
40
+ default: false
41
+
36
42
  option :wait_for_completion,
37
43
  aliases: "-w",
38
44
  type: :boolean,
@@ -10,6 +10,7 @@ module Automan::RDS
10
10
  :prune,
11
11
  :type,
12
12
  :max_snapshots,
13
+ :quiet,
13
14
  :wait_for_completion
14
15
 
15
16
  def initialize(options={})
@@ -76,7 +77,12 @@ module Automan::RDS
76
77
  db = find_db
77
78
 
78
79
  if db.nil? || !db.exists?
79
- raise DatabaseDoesNotExistError, "Database for #{environment} does not exist"
80
+ if quiet
81
+ logger.warn "Database for #{environment} does not exist"
82
+ exit
83
+ else
84
+ raise DatabaseDoesNotExistError, "Database for #{environment} does not exist"
85
+ end
80
86
  end
81
87
 
82
88
  myname = name.nil? ? default_snapshot_name(db) : name.dup
@@ -213,14 +219,6 @@ module Automan::RDS
213
219
  rds.snapshots.select {|s| snapshot_has_tags?(s, tags)}
214
220
  end
215
221
 
216
- #
217
- # There is a big broken assumption here!
218
- # We enumerate all snapshots of the *current* environment db
219
- # What if that db is new and we have snapshots from previous
220
- # dbs? The dev1 db is replaced every day!
221
- # So prunable_snapshots will only return the list of snapshots
222
- # from the *current* dev1 db and ignore all others!
223
- #
224
222
  def prune_snapshots
225
223
  logger.info "Pruning old db snapshots"
226
224
 
@@ -1,3 +1,3 @@
1
1
  module Automan
2
- VERSION = "2.4.0"
2
+ VERSION = "2.4.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: automan
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
  - Chris Chalfant