<commit_before>require 'fileutils'

module MCollective
  module Agent
    class Puppetupdate < RPC::Agent
      action "update_all" do
        load_puppet

        begin
          update_all_branches
          reply[:output] = "Done"
        rescue Exception => e
          reply.fail! "Exception: #{e}"
        end
      end

      action "update" do
        validate :revision, String
        validate :revision, :shellsafe
        validate :branch, String
        validate :branch, :shellsafe
        load_puppet

        begin
          ret = update_single_branch(request[:branch], request[:revision])
          if ret
	    reply[:status] = "Done"
            [:from, :to].each { |s| reply[s] = ret[s] }
	  else
	    reply[:status] = "Deleted"
	  end
        rescue Exception => e
          reply.fail! "Exception: #{e}"
        end
      end

      attr_accessor :dir, :repo_url, :ignore_branches, :run_after_checkout

      def initialize
        @dir                = config('directory', '/etc/puppet')<commit_msg>Whitespace<commit_after>require 'fileutils'

module MCollective
  module Agent
    class Puppetupdate < RPC::Agent
      action "update_all" do
        load_puppet

        begin
          update_all_branches
          reply[:output] = "Done"
        rescue Exception => e
          reply.fail! "Exception: #{e}"
        end
      end

      action "update" do
        validate :revision, String
        validate :revision, :shellsafe
        validate :branch, String
        validate :branch, :shellsafe
        load_puppet

        begin
          ret = update_single_branch(request[:branch], request[:revision])
          if ret
            reply[:status] = "Done"
            [:from, :to].each { |s| reply[s] = ret[s] }
          else
            reply[:status] = "Deleted"
          end
        rescue Exception => e
          reply.fail! "Exception: #{e}"
        end
      end

      attr_accessor :dir, :repo_url, :ignore_branches, :run_after_checkout

      def initialize
        @dir                = config('directory', '/etc/puppet')
{'fraction_non_alphanumeric': 0.09966134494436381, 'fraction_numerical': 0.0, 'mean_word_length': 1.868238557558946, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2185721', 'n_tokens_mistral': 603, 'n_tokens_neox': 590, 'n_words': 151}