Update version according to OSCI-856
[packages/precise/mcollective.git] / plugins / mcollective / discovery / flatfile.rb
index 7ce9db7b42dca6bdba8a83afe7e09c9b1c5afa0c..b183a2537c395fcce834aba0cf7c51d0c845bae9 100644 (file)
@@ -15,7 +15,11 @@ module MCollective
 
         discovered = []
 
-        hosts = File.readlines(file).map{|l| l.chomp}
+        hosts = File.readlines(file).map do |host|
+          host = host.chomp
+          raise 'Identities can only match /\w\.\-/' unless host.match(/^[\w\.\-]+$/)
+          host
+        end
 
         # this plugin only supports identity filters, do regex matches etc against
         # the list found in the flatfile