Exception: Machinery::Errors::MissingExtractedFiles
- Inherits:
-
SystemDescriptionError
- Object
- StandardError
- MachineryError
- SystemDescriptionError
- Machinery::Errors::MissingExtractedFiles
- Defined in:
- lib/exceptions.rb
Instance Method Summary collapse
-
#initialize(description, scopes) ⇒ MissingExtractedFiles
constructor
A new instance of MissingExtractedFiles.
- #to_s ⇒ Object
Constructor Details
#initialize(description, scopes) ⇒ MissingExtractedFiles
Returns a new instance of MissingExtractedFiles.
56 57 58 59 |
# File 'lib/exceptions.rb', line 56 def initialize(description, scopes) @description = description @scopes = scopes end |
Instance Method Details
#to_s ⇒ Object
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/exceptions.rb', line 61 def to_s = @description[@scopes.first]. hostname = @scopes.map do |s| @description[s]..hostname if @description[s]. end.compact.first || "<HOSTNAME>" formatted_scopes = Machinery::Ui.internal_scope_list_to_string(@scopes) cmd = "#{$0} inspect --extract-files --scope=#{formatted_scopes.delete(" ")}" cmd += " --name='#{@description.name}'" if hostname != @description.name cmd += " #{hostname}" if @scopes.count > 1 output = "The following scopes '#{formatted_scopes}' are part of the system description" else output = "The scope '#{formatted_scopes}' is part of the system description" end output += " but the corresponding files weren't extracted during inspection.\n" \ "The files are required to continue with this command." \ " Run `#{cmd}` to extract them." end |