<commit_before>
module CORL
module Action
class Exec < Plugin::CloudAction
 
  #----------------------------------------------------------------------------
  # Settings
  
  def configure
    super do
      codes :network_failure
            
      register :command, :array, nil
    end
  end
  
  #---
  
  def arguments
    [ :command ]
  end
 
  #-----------------------------------------------------------------------------
  # Operations
   
  def execute
    super do |node, network|
      if network && node
        command_str   = settings[:command].join(' ')
        result        = node.exec({ :commands => [ command_str ] }).first
        myself.status = result.status
      else
        myself.status = code.network_failure
      end
    end<commit_msg>Adding mutli word parameter quoting in the exec action provider.<commit_after>
module CORL
module Action
class Exec < Plugin::CloudAction
 
  #----------------------------------------------------------------------------
  # Settings
  
  def configure
    super do
      codes :network_failure
            
      register :command, :array, nil
    end
  end
  
  #---
  
  def arguments
    [ :command ]
  end
 
  #-----------------------------------------------------------------------------
  # Operations
   
  def execute
    super do |node, network|
      if network && node
        settings[:command].collect! do |value|
          if value.strip.match(/\s+/)
            value = "\"#{value}\""
          end
          value
        end
        
        command_str   = settings[:command].join(' ')
        result        = node.exec({ :commands => [ command_str ] }).first
        myself.status = result.status
      else
        myself.status = code.network_failure
      end
    end
{'fraction_non_alphanumeric': 0.2505694760820046, 'fraction_numerical': 0.0, 'mean_word_length': 1.1041916167664672, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2096244', 'n_tokens_mistral': 429, 'n_tokens_neox': 417, 'n_words': 116}