automan 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 +4 -4
- data/lib/automan/cli/snapper.rb +6 -0
- data/lib/automan/rds/snapshot.rb +7 -9
- data/lib/automan/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2bf6f3ba54e3992bdfb73a8151cc31ec35e2f00b
|
4
|
+
data.tar.gz: fb0621083299dfbf474aa90e4ba46a520432edbb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9dd3e1c72155f318cec831c661dbf07ff73cd464f2f617157e799e1ed0e4c697dee44787b9e9f6a166f95cf4f024f9c57f57acf2d6deff966bb38a1b7caa24b6
|
7
|
+
data.tar.gz: 15b0e024fe045714e812d6fadf05d6c1caa773a44ab380ba14ff9a25deb91aee4860e0500b6cac8d1a5008ba6407586f89bee2691b09cdf07e9f7a4dea8568d7
|
data/lib/automan/cli/snapper.rb
CHANGED
@@ -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,
|
data/lib/automan/rds/snapshot.rb
CHANGED
@@ -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
|
-
|
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
|
|
data/lib/automan/version.rb
CHANGED