73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
|
# File 'lib/exceptions.rb', line 73
def to_s
hostname = @scopes.map do |s|
@description[s].meta.hostname if @description[s].meta
end.compact.first || "<HOSTNAME>"
formatted_scopes = Machinery::Ui.internal_scope_list_to_string(@scopes)
if @description["environment"]["system_type"] == "docker"
inspect_cmd = "inspect-container"
else
inspect_cmd = "inspect"
end
cmd = "#{Ui::Hint.program_name} #{inspect_cmd} --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
|