puppet-ghostbuster 0.4.2 → 0.4.3
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 +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/puppet-ghostbuster/optparser.rb +6 -6
- data/lib/puppet-ghostbuster/version.rb +1 -1
- data/lib/puppet-ghostbuster.rb +23 -4
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fe22eeb59f0091363b234940fd33e7a59891d985
|
|
4
|
+
data.tar.gz: 9926ca96ceda0199032d3e0b5ae5e832eb1488b8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2ee740dc1a4e7dbd549c1e1d22197916a5365bdbd3df9af45e127805f7cf84b2005f8df3cbdc9f9447381718e30931d751184030147571f52818998e434b3870
|
|
7
|
+
data.tar.gz: 76cf2ad9801df5220493994e3b2b34cf49096f46eb16869a668a29a4fda4a8cbce560d9c1da390b4f0b45f7b8fb5d89e3d47324b870928f7abb5d7d7496dbc4d
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## [0.4.3](https://rubygems.org/gems/puppet-ghostbuster/versions/0.4.3) (2016-05-04)
|
|
4
|
+
[Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.4.2...0.4.3)
|
|
5
|
+
|
|
6
|
+
**Fixed bugs:**
|
|
7
|
+
|
|
8
|
+
- Less false positive
|
|
9
|
+
|
|
3
10
|
## [0.4.2](https://rubygems.org/gems/puppet-ghostbuster/versions/0.4.2) (2016-05-02)
|
|
4
11
|
[Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.4.1...0.4.2)
|
|
5
12
|
|
|
@@ -43,16 +43,16 @@ class PuppetGhostbuster::OptParser
|
|
|
43
43
|
PuppetGhostbuster.configuration.puppetdbserverurl = s
|
|
44
44
|
end
|
|
45
45
|
|
|
46
|
-
opts.on('--key FILE', 'Load private key from the given file.') do |
|
|
47
|
-
PuppetGhostbuster.configuration.hostprivkey
|
|
46
|
+
opts.on('--key FILE', 'Load private key from the given file.') do |key|
|
|
47
|
+
PuppetGhostbuster.configuration.hostprivkey = key
|
|
48
48
|
end
|
|
49
49
|
|
|
50
|
-
opts.on('--cert FILE', 'Load cert from the given file.') do |
|
|
51
|
-
PuppetGhostbuster.configuration.hostcert
|
|
50
|
+
opts.on('--cert FILE', 'Load cert from the given file.') do |cert|
|
|
51
|
+
PuppetGhostbuster.configuration.hostcert = cert
|
|
52
52
|
end
|
|
53
53
|
|
|
54
|
-
opts.on('--ca FILE', 'Load local ca cert from the given file.') do |
|
|
55
|
-
PuppetGhostbuster.configuration.localcacert
|
|
54
|
+
opts.on('--ca FILE', 'Load local ca cert from the given file.') do |ca|
|
|
55
|
+
PuppetGhostbuster.configuration.localcacert = ca
|
|
56
56
|
end
|
|
57
57
|
|
|
58
58
|
opts.load('/etc/puppet-ghostbuster.rc')
|
data/lib/puppet-ghostbuster.rb
CHANGED
|
@@ -146,21 +146,40 @@ class PuppetGhostbuster
|
|
|
146
146
|
files.each do |file|
|
|
147
147
|
next unless File.file?(file)
|
|
148
148
|
module_name, file_name = file.match(/.*\/([^\/]+)\/files\/(.+)$/).captures
|
|
149
|
-
|
|
149
|
+
found = false
|
|
150
|
+
|
|
151
|
+
found = true if self.class.client.request('resources', [:'=', ['parameter', 'source'], "^puppet:///modules/#{module_name}/#{file_name}$"],).data.size > 0
|
|
152
|
+
|
|
153
|
+
dir_name = File.dirname(file_name)
|
|
154
|
+
while dir_name != '.' do
|
|
155
|
+
found = true if self.class.client.request(
|
|
156
|
+
'resources',
|
|
157
|
+
[:'and',
|
|
158
|
+
[:'=', ['parameter', 'source'], "^puppet:///modules/#{module_name}/#{dir_name}/?$"],
|
|
159
|
+
[:'=', ['parameter', 'recurse'], true],
|
|
160
|
+
],
|
|
161
|
+
).data.size > 0
|
|
162
|
+
dir_name = File.dirname(dir_name)
|
|
163
|
+
end
|
|
164
|
+
|
|
150
165
|
manifests.each do |manifest|
|
|
151
166
|
if File.symlink?(manifest)
|
|
152
167
|
@@logger.warn " Skipping symlink #{manifest}"
|
|
153
168
|
next
|
|
154
169
|
end
|
|
170
|
+
|
|
155
171
|
if match = manifest.match(/.*\/([^\/]+)\/manifests\/.+$/)
|
|
156
172
|
manifest_module_name = match.captures[0]
|
|
157
173
|
if manifest_module_name == module_name
|
|
158
|
-
|
|
174
|
+
found = true if File.readlines(manifest).grep(/["']\$\{module_name\}\/#{file_name}["']/).size > 0
|
|
175
|
+
break if found
|
|
159
176
|
end
|
|
160
177
|
end
|
|
161
|
-
|
|
178
|
+
found = true if File.readlines(manifest).grep(/#{module_name}\/#{file_name}/).size > 0
|
|
179
|
+
break if found
|
|
162
180
|
end
|
|
163
|
-
|
|
181
|
+
|
|
182
|
+
@@issues << { :title => "[GhostBuster] File #{module_name}/#{file_name} seems unused", :body => file } if found
|
|
164
183
|
end
|
|
165
184
|
end
|
|
166
185
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: puppet-ghostbuster
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Camptocamp
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-05-
|
|
11
|
+
date: 2016-05-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: coveralls
|