malsh 0.1.9 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 909e9f89338418efa785be0451d5ac92efde5d8c
4
- data.tar.gz: 49af40c47f81489fecbfadfa21ef39f4008dc607
3
+ metadata.gz: 347a943b1a31d9e96ce868829ed7244ee1f9b7e4
4
+ data.tar.gz: d8292cf71492b05ec754738f8674af60160c806d
5
5
  SHA512:
6
- metadata.gz: bcc02b83833ad620e47ab21c3cc5a99c8ecb4a74ccf95e788b7fc13f3a1ac2c187ad5a5c5ba4af36e3dd528645b6c267fca2b27d87571450dc7d3f3e8e1cf754
7
- data.tar.gz: 5627a26be7a04d0bd7ed5fe5eebdf713bac8251da1a7dbb7a9f4a94b78b469f930c328882e845dce24891577d31b993494b6194fe6d08fd3d4789a419da62f23
6
+ metadata.gz: 8063808bd39e8639033f6586ea3df71dd820221e228e9c6cb6ca937fc2c41ebed7df0de82e8a0b0fb23936836516ffe78030cd376315862302aa74b16eddd47e
7
+ data.tar.gz: 27656b665489d656235323d93015cb915e8c212646510885f4f66c555288ddf9669e51b98dbfb9f84fb028ed18b46cb89c49b7554ac727cc91efc227716971b7
data/README.md CHANGED
@@ -54,6 +54,8 @@ $ malsh search --past_date 7 --cpu 40 --memory 40 --subject 過去7日間のCPU
54
54
  * 除外したいホスト名を正規表現で指定します。
55
55
  * --regex
56
56
  * 特定したいホスト名を正規表現で指定します。
57
+ * --invert-role
58
+ * 除外したいロール名を`service:role`で指定します。
57
59
 
58
60
  ## Author
59
61
  pyama86
data/lib/malsh.rb CHANGED
@@ -35,6 +35,11 @@ module Malsh
35
35
  Malsh.options[:invert_match] && Malsh.options[:invert_match].find {|v| host_name(h).match(/#{v}/) }
36
36
  end.reject do |h|
37
37
  Malsh.options[:regexp] && Malsh.options[:regexp].all? {|r| !host_name(h).match(/#{r}/)}
38
+ end.reject do |h|
39
+ Malsh.options[:invert_role] && Malsh.options[:invert_role].find do |r|
40
+ service, role = r.split(/:/)
41
+ h.roles[service] && h.roles[service].include?(role)
42
+ end
38
43
  end
39
44
  end
40
45
 
data/lib/malsh/cli.rb CHANGED
@@ -9,6 +9,7 @@ module Malsh
9
9
  class_option :api_key, :type => :string, :aliases => :k
10
10
  class_option :subject, :type => :string, :aliases => :s
11
11
  class_option :invert_match, :type => :array, :aliases => :v
12
+ class_option :invert_role, :type => :array, :aliases => :r
12
13
  class_option :regexp,:type => :array, :aliases => :e
13
14
 
14
15
  desc 'retire', 'check forget retire host'
data/lib/malsh/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Malsh
2
- VERSION = "0.1.9"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: malsh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - kazuhiko yamahsita
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-04-11 00:00:00.000000000 Z
11
+ date: 2016-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor