Class: Bosh::Agent::Mounter
Instance Method Summary collapse
-
#initialize(logger, shell_runner = Bosh::Exec) ⇒ Mounter
constructor
A new instance of Mounter.
- #mount(partition, mount_point, options_hash = {}) ⇒ Object
Constructor Details
#initialize(logger, shell_runner = Bosh::Exec) ⇒ Mounter
Returns a new instance of Mounter.
5 6 7 8 |
# File 'lib/bosh_agent/mounter.rb', line 5 def initialize(logger, shell_runner=Bosh::Exec) @logger = logger @shell_runner = shell_runner end |
Instance Method Details
#mount(partition, mount_point, options_hash = {}) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/bosh_agent/mounter.rb', line 10 def mount(partition, mount_point, ={}) @logger.info("Mounting: #{partition} #{mount_point}") = () results = shell_runner.sh("mount #{} #{partition} #{mount_point}", on_error: :return) if results.failed? raise Bosh::Agent::MessageHandlerError, "Failed to mount: '#{partition}' '#{mount_point}' Exit status: #{results.exit_status} Output: #{results.output}" end end |