lib/exceptions.rb in machinery-tool-1.16.1 vs lib/exceptions.rb in machinery-tool-1.16.2

- old
+ new

@@ -63,11 +63,18 @@ 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) - cmd = "#{Hint.program_name} inspect --extract-files --scope=#{formatted_scopes.delete(" ")}" + if @description["environment"]["system_type"] == "docker" + inspect_cmd = "inspect-container" + else + inspect_cmd = "inspect" + end + + cmd = "#{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" @@ -143,9 +150,20 @@ class ServerPortError < MachineryError attr_reader :message def initialize(message) @message = message + end + end + class BuildDirectoryCreateError < MachineryError + def initialize(directory, user) + @directory = directory + @user = user + end + + def to_s + "Could not create build directory '#{@directory}' because the user '#{@user}' does not " \ + "have sufficient permissions." end end end end