elasticDynamoDb 1.0.4 → 1.0.5
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 +8 -8
- data/bin/elasticDynamoDb +5 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MTk3MWNmZDA0YWRhODU5YmFkODk1MjA5NWFkMmE2OGQ2MzczMzMyZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
Mjk4ZmM4NmQ0NmEyMmFlZDgyMWNlZmFjM2I2OGFhM2VmYjI0MDljMQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NzMwMDE0MjYwZDcyZWJiNzFiODg3NWQ1ZjFhOTViNzZhMzk5NzdlNTExODRm
|
10
|
+
MTdiOGQ2NDQ1M2U5OWFiNzk3NTQ2NTkwZjExYjQ1NzhjMWVlYTc0ZTQ1OWNk
|
11
|
+
ZDkwY2I4MGQ3NjlhYWMwMWU0MGNhYWM3N2JmNGI4N2RjMTg0ODE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YmFkMWQxMTFlZWQzZDYxMDk3OGQwYzNlZTc4MDNkZjY0ZDdmY2Y5Nzc2ZGNi
|
14
|
+
M2ViODRlYjVjZDNiOWQ5MWE0Mzg4ZjkyNjcxYTA2ZmE0MzM4M2M3OTIwZDM3
|
15
|
+
ZjNlNWI5MmI4ZWI3MWI4MzNjZjZmNDc1ODdmZTYyZDAxMjdkYmE=
|
data/bin/elasticDynamoDb
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
require 'thor'
|
3
3
|
require 'aws-sdk'
|
4
4
|
require 'fileutils'
|
5
|
+
require 'pathname'
|
6
|
+
|
5
7
|
require_relative '../lib/configparser'
|
6
8
|
|
7
9
|
class ElasticDynamoDb < Thor
|
@@ -11,7 +13,7 @@ class ElasticDynamoDb < Thor
|
|
11
13
|
desc "onDemand", "Ease autoscale by schedule or scale factor"
|
12
14
|
method_option :factor, :required => true, :alias => 'f', :type => :numeric, :banner => 'scale factor can be decimal too 0.5 for instance'
|
13
15
|
method_option :schedule_restore, :alias => 's', :type => :numeric, :banner => 'number of minutes for ElasticDynamoDb to restore original values', :default => 0
|
14
|
-
method_option :working_dir, :default => '
|
16
|
+
method_option :working_dir, :default => system('pwd'), :alais => 'd', :banner => 'location for backup config and change log [default current dir]'
|
15
17
|
method_option :config_file, :required => true, :alias => 'c', :banner => 'location of dynamic-dynamodb.conf'
|
16
18
|
method_option :stop_cmd, :banner => 'bash stop command for dynamic-dynamodb service'
|
17
19
|
method_option :start_cmd, :banner => 'bash start command for dynamic-dynamodb service'
|
@@ -23,7 +25,7 @@ class ElasticDynamoDb < Thor
|
|
23
25
|
@@working_dir = options[:working_dir]
|
24
26
|
@@bkp_folder = "#{File.expand_path(@@working_dir)}/ElasticDynamoDb/dynamodb_config_backups"
|
25
27
|
@@log_file = "#{File.expand_path(@@working_dir)}/ElasticDynamoDb/change.log"
|
26
|
-
@@original_config_file = "#{@@bkp_folder}/#{@@config_file}-#{@@timestamp}"
|
28
|
+
@@original_config_file = "#{@@bkp_folder}/#{Pathname.new(@@config_file).basename.to_s}-#{@@timestamp}"
|
27
29
|
|
28
30
|
FileUtils.mkdir_p "#{File.expand_path(@@working_dir)}/ElasticDynamoDb/dynamodb_config_backups"
|
29
31
|
|
@@ -177,7 +179,7 @@ private
|
|
177
179
|
`mkdir -p #{@@bkp_folder} && cp #{@@config_file} #{@@original_config_file}` if @@config_file
|
178
180
|
say "backup file created: #{@@original_config_file}"
|
179
181
|
end
|
180
|
-
|
182
|
+
`
|
181
183
|
def save_file(str)
|
182
184
|
File.open(@@config_file, 'w') do |file|
|
183
185
|
file.write str
|