X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=plugins%2Fmcollective%2Fdiscovery%2Fflatfile.rb;h=b183a2537c395fcce834aba0cf7c51d0c845bae9;hb=d1f1649ba43c5cbc43c4beb2380096ba051d646a;hp=7ce9db7b42dca6bdba8a83afe7e09c9b1c5afa0c;hpb=b87d2f4e68281062df1913440ca5753ae63314a9;p=packages%2Fprecise%2Fmcollective.git diff --git a/plugins/mcollective/discovery/flatfile.rb b/plugins/mcollective/discovery/flatfile.rb index 7ce9db7..b183a25 100644 --- a/plugins/mcollective/discovery/flatfile.rb +++ b/plugins/mcollective/discovery/flatfile.rb @@ -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