reyes 1.2.5 → 1.2.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/reyes +22 -0
  3. data/lib/reyes/version.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 87d2b4742ca4301e834e9a4d6c752f77e927641d
4
- data.tar.gz: 5a1eb6724469ac979c13630fda028b0640b6d215
3
+ metadata.gz: aee98a9cbc8ed42310ebf0edeac2193d8c919f84
4
+ data.tar.gz: 461a416f7ea2a33953792d0bbbe4677c1e895e0f
5
5
  SHA512:
6
- metadata.gz: 90d88464ac17c3468d8eb575edde219b9f0e4b649ef74b3a7528bc30e68289c408a87bbb12b01e6e151dfde2aea7f1983f46aad19a2d1f94b9d8b020605ec8ae
7
- data.tar.gz: 44dd2a640696262099fffb5f9a3d209d1693b939ac611ad8246a1410a6744bee725fe5e8c18aa40b69af39007d4b1db93d69dc101beef505f9a93721ff5a2eb1
6
+ metadata.gz: dfa634f9ec9e5f317faf5fdd6736c6e9342f88d6f88ba7c25e5b7a9cb38bb5d56b5308dada3db28d351eb0726bed005eb25146486cb14eb55e1548e28ce50d7b
7
+ data.tar.gz: 17b0c2e6fa7d23906845ee5edbf4a0e7327f4baff113e679e80b0a7601f26a38777c5179fc443918f158e49b97e779b820f8a1614e27cefe7252fd987fd2b746
data/bin/reyes CHANGED
@@ -2,6 +2,22 @@
2
2
  require 'optparse'
3
3
  require_relative '../lib/reyes'
4
4
 
5
+ REYES_STOP_FILE = '/run/reyes-stop'
6
+
7
+ def exit_if_stopped!(options)
8
+ if File.file?(REYES_STOP_FILE)
9
+ if options[:ignore_stop_file]
10
+ STDERR.puts "#{REYES_STOP_FILE} exists but --ignore-stop-file present, proceeding!"
11
+ else
12
+ STDERR.puts "#{REYES_STOP_FILE} exists, exiting without modifying local system state!"
13
+ if File.size(REYES_STOP_FILE) > 0
14
+ STDERR.puts "Stop file contents: " + File.read(REYES_STOP_FILE)
15
+ end
16
+ exit 0 # 0 rather than 1 to avoid cron-spam possibility
17
+ end
18
+ end
19
+ end
20
+
5
21
  def command_dump(output_file, options)
6
22
  aws = Reyes::AwsManager.new(options[:config])
7
23
  aws.dump_fake_data(output_file)
@@ -114,6 +130,10 @@ For example:
114
130
  Options:
115
131
  EOM
116
132
 
133
+ opts.on('--ignore-stop-file', "Ignore presence of Reyes stop file (#{REYES_STOP_FILE})") do |config|
134
+ options[:ignore_stop_file] = true
135
+ end
136
+
117
137
  opts.on('-c', '--config CONFIG', 'YAML config file') do |config|
118
138
  options[:config] = config
119
139
  end
@@ -172,6 +192,8 @@ Options:
172
192
 
173
193
  optparse.parse!
174
194
 
195
+ exit_if_stopped!(options)
196
+
175
197
  command = ARGV.shift
176
198
  case command
177
199
  when 'dump'
data/lib/reyes/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Reyes
2
2
  # The Reyes version number
3
- VERSION = '1.2.5' unless defined?(self::VERSION)
3
+ VERSION = '1.2.6' unless defined?(self::VERSION)
4
4
 
5
5
  # Number defining the JSON serialization format
6
6
  JSON_FORMAT_VERSION = 2 unless defined?(self::JSON_FORMAT_VERSION)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reyes
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.5
4
+ version: 1.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Brody
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-07-23 00:00:00.000000000 Z
12
+ date: 2015-08-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aws-sdk