Skip to content

Instantly share code, notes, and snippets.

@jonlives
Created May 15, 2012 10:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonlives/2700743 to your computer and use it in GitHub Desktop.
Save jonlives/2700743 to your computer and use it in GitHub Desktop.
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