This file contains hidden or 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
| #Chef::REST::AuthCredentials accepts only filenames by default | |
| #this extends the Chef::REST::AuthCredentials so that the key can be provided directly | |
| require 'chef/rest/auth_credentials' | |
| class Chef | |
| class REST | |
| class AuthCredentials | |
| alias :original_load_signing_key :load_signing_key | |
| def load_signing_key | |
| if key_file.start_with?("-----BEGIN RSA PRIVATE KEY-----") |
This file contains hidden or 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
| require 'rubygems' | |
| require 'nokogiri' | |
| while true | |
| doc=Nokogiri::XML(open('test.xml')) | |
| xpath_query="//MetricTemplate[@name=\"Availability\" or @name=\"does not exist\"]" | |
| puts "xpath: #{xpath_query}" | |
| result = doc.xpath(xpath_query) | |
| if result.length>1 | |
| puts "duplicate:" |
NewerOlder