Class: PuppetX::EnterpriseModules::OraInstall::OpatchCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/puppet_x/enterprisemodules/ora_install/opatch_command.rb

Overview

docs

Constant Summary

Constants inherited from Command

Command::DEFAULT_TIMEOUT, Command::VALID_OPTIONS

Instance Method Summary collapse

Methods inherited from Command

#command_string

Constructor Details

#initialize(options = {}) ⇒ OpatchCommand

Returns a new instance of OpatchCommand.



12
13
14
# File 'lib/puppet_x/enterprisemodules/ora_install/opatch_command.rb', line 12

def initialize(options = {})
  super(:opatch, options)
end

Instance Method Details

#execute(arguments, command_options) ⇒ Object



16
17
18
19
20
21
22
23
24
# File 'lib/puppet_x/enterprisemodules/ora_install/opatch_command.rb', line 16

def execute(arguments, command_options)
  options = { :failonfail => true, :combine => true }
  value = ''
  command = command_string(arguments, command_options)
  Puppet.debug "Executing #{@command} command: #{arguments} as #{os_user}"
  value = Puppet::Util::Execution.execute(command, options)
  raise 'Opatch contained an error' unless value =~ /OPatch completed|OPatch succeeded|opatch auto succeeded|opatchauto succeeded/
  value
end