Exception: Machinery::Errors::SudoPasswordRequired

Inherits:
MachineryError show all
Defined in:
lib/exceptions.rb

Overview

An error for inspecting a remote system as a non-root user

Instance Method Summary collapse

Constructor Details

#initialize(host) ⇒ SudoPasswordRequired

Returns a new instance of SudoPasswordRequired.



158
159
160
# File 'lib/exceptions.rb', line 158

def initialize(host)
  @host = host
end

Instance Method Details

#to_sObject



162
163
164
165
166
# File 'lib/exceptions.rb', line 162

def to_s
  "`sudo` can be used only on #{@host}, when no password is required." \
  " Make sure that you have the following line in `etc/sudoers` on the remote host:\n" \
  " machinery ALL=(ALL) NOPASSWD: ALL"
end