def chef_client_search(name, run_list, environment)
      search = []
      search.push("name:#{name}") if name
      search.push("chef_environment:#{environment}") if environment
      run_list.split(",").each do |item|
        item.sub!(/\[/, ":")
        item.chop!
        item.sub!(/::/, '\:\:')
        search.push(item)
      end
      "#{search.join(' AND ')}"
    end
def chef_client_search(name, run_list, environment)
      search = []
      search.push("name:#{name}") if name
      search.push("chef_environment:#{environment}") if environment
      run_list.split(",").each do |item|
        item.sub!(/\[/, ":")
        item.chop!
        item.sub!(/::/, '\:\:')
        search.push(item)
      end
      "#{search.join(' AND ')}"
    end
create the knife ssh chef-client search pattern