Class: PuppetX::EnterpriseModules::OraInstall::OpatchautoCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/puppet_x/enterprisemodules/ora_install/opatchauto_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 = {}) ⇒ OpatchautoCommand

Returns a new instance of OpatchautoCommand.



11
12
13
# File 'lib/puppet_x/enterprisemodules/ora_install/opatchauto_command.rb', line 11

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

Instance Method Details

#execute(arguments, command_options) ⇒ Object



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

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)
  # Add 2 minutes sleep because opatchauto doesn't always wait until everything is running (maybe only in =<12.2?)
  sleep 120
  raise 'Opatch contained an error' unless value =~ /OPatch completed|OPatch succeeded|opatch auto succeeded|opatchauto succeeded|OPatchAuto successful/
  value
end