knife-scrub 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZjE4YjEwNjRhOTU0ZTNhYzcyNGJkOGE1Njk4MWNlMDRkMWU5M2QyNA==
4
+ ODIyYjQyNjYxYzhlZmJmMDFhMmVkMmM3ZWFjY2JjYzU3NDhmOGM3NA==
5
5
  data.tar.gz: !binary |-
6
- ZjQzYjQxYTg5NGMwZWI0N2JjY2M3MmRmZDM1ODkyYTZjMjI4MjZkZQ==
6
+ NDljMjNjNzRkOGJlYzhkNTcwZGM0ZjE0NDQ2MTc1NTYzZDliNmVkNA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NjNiY2MwMzk4Nzk1NzcxZTRlMDAwOGQxZWUxYzQ3YWU1M2U1ZTBjYTcwYWNi
10
- YzA2NTA1YzZiMTAwNDc2MjIzMmU4OTM0YzE3Yzk1ZDQ5ZGNjZDM4MWIyMTcw
11
- YzU2YTRlNDA0YTMxMjBkMWIzYzA4NTJhYzg2NjhkYTI5NWQ0Zjc=
9
+ Mjk3NTVlZDQ5MzRlYWIzYjQyODBhZDg2ZDBmMDNkYzFlMjM4OTM1NmNiNzU4
10
+ MTYzM2M0OTg1ZjkwOTlkMzZmYTNjNzZjMDI5ZGM2YmE5NmRjNDMzZTk4MjBm
11
+ ZjhhMjlhM2FhN2VlZjAzNDg0ODk4NDNmZTc5NmY5N2RiNGRhNjI=
12
12
  data.tar.gz: !binary |-
13
- MWMzZTJiOTUyMGYyZmEyZjc5YTk3YjZlNTJiZjI3NDI3YmNlYzdlYjc5NGIw
14
- ZDZmZjM2MTM1ZTk4MmZjNzU1OWFkYzk5YmNiMDg3MjYzM2NjMzY2NDkyZjdm
15
- ZWFmNzBkNmI0NTkwMjI2ZGE1NWRlMzczNzdiM2IwN2FmODJmMzY=
13
+ OTc0NGQ3YWY4MjgwYmRiNjZjYTA2YzFhNmU2YmU4ZjJiN2M5YzE1Yzk4NGJh
14
+ ZmFiN2ZmYmFmYTNjYWVhZTY2MDUyMjYyZGNkNmM3MWZhZTczMGJmMDUyZmEy
15
+ MjY5NDMyODk0ZTMzNWY2NGNiMmU5YzRlMmNlNzczZTRmZjI0ZmU=
@@ -36,6 +36,12 @@ class Chef
36
36
  :description => "Limit nodes with provided query. Default: #{DEFAULT_QUERY}",
37
37
  :default => DEFAULT_QUERY
38
38
 
39
+ option :dry_run,
40
+ :short => '-d',
41
+ :long => '--dry-run',
42
+ :description => "Show nodes which have normal attributes",
43
+ :default => false
44
+
39
45
  def run
40
46
  unless prefix = name_args.first
41
47
  show_usage
@@ -48,11 +54,16 @@ class Chef
48
54
  extractor = Scrub::AttributeExtractor.create(node)
49
55
 
50
56
  unless extractor.has_key?(prefix)
51
- ui.msg format(node, "unknown normal attribute #{prefix}")
57
+ ui.msg format(node, "normal attribute #{prefix} not present")
52
58
  next
53
59
  end
54
60
 
55
61
  value = extractor.fetch(prefix)
62
+ if config[:dry_run]
63
+ ui.msg format(node, "normal attribute #{prefix}: #{value.inspect}")
64
+ next
65
+ end
66
+
56
67
  unless ui.confirm format(node, "Do you want to delete #{value.inspect}")
57
68
  next
58
69
  end
@@ -18,7 +18,7 @@
18
18
 
19
19
  module Knife
20
20
  module Scrub
21
- VERSION = '0.2.0'
21
+ VERSION = '0.3.0'
22
22
  MAJOR, MINOR, TINY = VERSION.split('.')
23
23
  end
24
24
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-scrub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Schmidt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-01 00:00:00.000000000 Z
11
+ date: 2014-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef
@@ -74,8 +74,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
74
  version: '0'
75
75
  requirements: []
76
76
  rubyforge_project:
77
- rubygems_version: 2.1.2
77
+ rubygems_version: 2.1.11
78
78
  signing_key:
79
79
  specification_version: 4
80
80
  summary: knife plugin to scrub normal attributes of chef-server
81
81
  test_files: []
82
+ has_rdoc: