Class: Puppet_X::Coi::Jboss::Internal::ExecutionStateWrapper
- Inherits:
- 
      Object
      
        - Object
- Puppet_X::Coi::Jboss::Internal::ExecutionStateWrapper
 
- Defined in:
- lib/puppet_x/coi/jboss/internal/execution_state_wrapper.rb
Overview
System executor responsible of executing provided commands
Instance Attribute Summary collapse
- 
  
    
      #shell_executor  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Standard setter for shell_executor. 
Instance Method Summary collapse
- 
  
    
      #execute(cmd, jbosscmd, environment)  ⇒ Puppet_X::Coi::Jboss::Internal::ExecutionState 
    
    
  
  
  
  
  
  
  
  
  
    Method that handles delegation to system executor information about result of execution. 
- 
  
    
      #initialize(shell_executor)  ⇒ ExecutionStateWrapper 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    Standard constructor. 
- 
  
    
      #last_execute_result  ⇒ Process::Status 
    
    
  
  
  
  
  
  
  
  
  
    Method that returns status of last command executed. 
Constructor Details
#initialize(shell_executor) ⇒ ExecutionStateWrapper
Standard constructor
| 6 7 8 | # File 'lib/puppet_x/coi/jboss/internal/execution_state_wrapper.rb', line 6 def initialize(shell_executor) @shell_executor = shell_executor end | 
Instance Attribute Details
#shell_executor ⇒ Object
Standard setter for shell_executor
| 11 12 13 | # File 'lib/puppet_x/coi/jboss/internal/execution_state_wrapper.rb', line 11 def shell_executor @shell_executor end | 
Instance Method Details
#execute(cmd, jbosscmd, environment) ⇒ Puppet_X::Coi::Jboss::Internal::ExecutionState
Method that handles delegation to system executor information about result of execution
| 19 20 21 22 23 24 25 26 27 28 29 | # File 'lib/puppet_x/coi/jboss/internal/execution_state_wrapper.rb', line 19 def execute(cmd, jbosscmd, environment) lines = exec_command(cmd, environment) result = last_execute_result code = result.exitstatus success = result.success? Puppet.debug 'execution state begins' exececution_state(jbosscmd, code, success, lines) end | 
#last_execute_result ⇒ Process::Status
Method that returns status of last command executed
| 33 34 35 | # File 'lib/puppet_x/coi/jboss/internal/execution_state_wrapper.rb', line 33 def last_execute_result @result end |