Created
May 15, 2012 10:42
-
-
Save jonlives/2700743 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rule "ETSY005", "Action :restart sent to a core service" do | |
tags %w{correctness recipe etsy} | |
recipe do |ast, filename| | |
res = ast.xpath('//command[ident/@value = "notifies"]/args_add_block[descendant::symbol/ident/@value="restart"]/descendant::method_add_arg[fcall/ident/@value="resources"]/descendant::assoc_new[symbol/ident/@value="service"]/descendant::tstring_content') | |
res.each do |notifies| | |
if notifies.attribute('value').to_s.include?('nscd') | |
[match(res)] | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment