Class: Opsmgr::BoshCommandRunner
- Inherits:
-
Object
- Object
- Opsmgr::BoshCommandRunner
- Defined in:
- lib/opsmgr/bosh_command_runner.rb
Instance Method Summary collapse
-
#initialize(bosh_command:, logger:) ⇒ BoshCommandRunner
constructor
A new instance of BoshCommandRunner.
- #run(command) ⇒ Object
- #run_and_capture_output(command) ⇒ Object
Constructor Details
#initialize(bosh_command:, logger:) ⇒ BoshCommandRunner
Returns a new instance of BoshCommandRunner.
3 4 5 6 |
# File 'lib/opsmgr/bosh_command_runner.rb', line 3 def initialize(bosh_command:, logger:) @bosh_command = bosh_command @logger = logger end |
Instance Method Details
#run(command) ⇒ Object
8 9 10 11 12 13 |
# File 'lib/opsmgr/bosh_command_runner.rb', line 8 def run(command) system_or_fail( "#{bosh_command_prefix} #{command}", "bosh #{command} failed" ) end |
#run_and_capture_output(command) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/opsmgr/bosh_command_runner.rb', line 15 def run_and_capture_output(command) capture_output_or_fail( "#{bosh_command_prefix} #{command}", "bosh #{command} failed" ) end |