Class: VagrantPlugins::Berkshelf::BerksCommandFailed
- Inherits:
-
Vagrant::Errors::VagrantError
- Object
- Vagrant::Errors::VagrantError
- VagrantPlugins::Berkshelf::BerksCommandFailed
- Defined in:
- lib/vagrant-berkshelf/errors.rb
Instance Method Summary collapse
- #chefdk? ⇒ Boolean
- #error_message ⇒ Object
-
#initialize(command, stdout, stderr) ⇒ BerksCommandFailed
constructor
A new instance of BerksCommandFailed.
- #not_chefdk_message ⇒ Object
Constructor Details
#initialize(command, stdout, stderr) ⇒ BerksCommandFailed
Returns a new instance of BerksCommandFailed.
25 26 27 28 |
# File 'lib/vagrant-berkshelf/errors.rb', line 25 def initialize(command, stdout, stderr) @command, @stdout, @stderr = command, stdout, stderr super end |
Instance Method Details
#chefdk? ⇒ Boolean
30 31 32 |
# File 'lib/vagrant-berkshelf/errors.rb', line 30 def chefdk? @command.include?("chefdk") end |
#error_message ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/vagrant-berkshelf/errors.rb', line 44 def base = <<-EOH The following berks command failed to execute: #{@command} The stdout and stderr are shown below: stdout: #{@stdout} stderr: #{@stderr} EOH base << "\n#{}" if !chefdk? base end |
#not_chefdk_message ⇒ Object
34 35 36 37 38 39 40 41 42 |
# File 'lib/vagrant-berkshelf/errors.rb', line 34 def <<-EOH It appears that you are not using the ChefDK. Please note that Vagrant Berkshelf works best when used with the ChefDK, and other installation methods are not officially supported. #{INSTALL_CHEFDK_INSTRUCTIONS} EOH end |