ebs-snapshoter 0.1.0 → 0.1.2
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.
- data/VERSION +1 -1
- data/lib/snapshoter/manager.rb +2 -2
- data/lib/snapshoter/volume.rb +3 -2
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
data/lib/snapshoter/manager.rb
CHANGED
@@ -29,14 +29,14 @@ module Snapshoter
|
|
29
29
|
success = false
|
30
30
|
begin
|
31
31
|
lock_mysql(mysql) if mysql
|
32
|
-
freeze_xfs(volume.mount_point)
|
32
|
+
freeze_xfs(volume.mount_point) if volume.freeze_xfs
|
33
33
|
@provider.snapshot_volume(volume)
|
34
34
|
rescue Exception => e
|
35
35
|
logger.error "[Volume #{volume}] There was a problem creating snapshot!"
|
36
36
|
logger.error e.message
|
37
37
|
logger.error e.backtrace.join("\n")
|
38
38
|
ensure
|
39
|
-
unfreeze_xfs(volume.mount_point)
|
39
|
+
unfreeze_xfs(volume.mount_point) if volume.freeze_xfs
|
40
40
|
if mysql
|
41
41
|
unlock_mysql(mysql)
|
42
42
|
mysql.close
|
data/lib/snapshoter/volume.rb
CHANGED
@@ -13,13 +13,14 @@ module Snapshoter
|
|
13
13
|
class Volume
|
14
14
|
ValidFrequencies = [:hourly, :daily, :weekly]
|
15
15
|
|
16
|
-
attr_reader :id, :mount_point, :frequency, :freeze_mysql, :mysql_user, :mysql_password, :mysql_port, :mysql_sock, :keep
|
16
|
+
attr_reader :id, :mount_point, :frequency, :freeze_mysql, :freeze_xfs, :mysql_user, :mysql_password, :mysql_port, :mysql_sock, :keep
|
17
17
|
|
18
18
|
def initialize(volume_id, options={})
|
19
19
|
options = options.symbolize_keys
|
20
20
|
|
21
21
|
@id = volume_id
|
22
22
|
@mount_point = options.delete(:mount_point)
|
23
|
+
@freeze_xfs = options.delete(:freeze_xfs) || false
|
23
24
|
@frequency = options.delete(:frequency) || 'daily'
|
24
25
|
@freeze_mysql = options.delete(:freeze_mysql) || false
|
25
26
|
@mysql_user = options.delete(:mysql_user) || 'root'
|
@@ -44,7 +45,7 @@ module Snapshoter
|
|
44
45
|
|
45
46
|
errors << 'volume must have an id' if @id.nil?
|
46
47
|
errors << "frequency must be one of #{ValidFrequencies.join(",")}" unless ValidFrequencies.include?(@frequency)
|
47
|
-
errors << 'mount_point must be specified' if @mount_point.nil?
|
48
|
+
errors << 'mount_point must be specified if freeze_xfs is true' if @mount_point.nil? && @freeze_xfs
|
48
49
|
errors << 'freeze_mysql must be true or false' if @freeze_mysql != true && @freeze_mysql != false
|
49
50
|
errors << "keep must be greater than 0" if keep <= 0
|
50
51
|
|