Class: PuppetX::EnterpriseModules::OraInstall::OpatchCommand
- 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
- #execute(arguments, command_options) ⇒ Object
-
#initialize(options = {}) ⇒ OpatchCommand
constructor
A new instance of OpatchCommand.
Methods inherited from Command
Constructor Details
#initialize(options = {}) ⇒ OpatchCommand
Returns a new instance of OpatchCommand.
11 12 13 |
# File 'lib/puppet_x/enterprisemodules/ora_install/opatch_command.rb', line 11 def initialize( = {}) super(:opatch, ) end |
Instance Method Details
#execute(arguments, command_options) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/puppet_x/enterprisemodules/ora_install/opatch_command.rb', line 15 def execute(arguments, ) if Facter.value(:kernel) == 'windows' environment = {} oracle_home = [:oracle_home] environment[:PATH] = "C:\\Windows\\system32;C:\\Windows;#{oracle_home}\\bin;#{oracle_home}\\OPatch" environment[:ORACLE_HOME] = oracle_home = { :failonfail => true, :combine => true, :custom_environment => environment } else = { :failonfail => true, :combine => true } end value = '' command = command_string(arguments, ) Puppet.debug "Executing #{@command} command: #{arguments} as #{os_user}" value = Puppet::Util::Execution.execute(command, ) raise 'Opatch contained an error' unless value =~ /OPatch completed|OPatch succeeded|opatch auto succeeded|opatchauto succeeded/ value end |