lib/shelly/cli/file.rb in shelly-0.5.5 vs lib/shelly/cli/file.rb in shelly-0.5.6
- old
+ new
@@ -13,20 +13,22 @@
desc "list [PATH]", "List files in given path"
def list(path = "/")
app = multiple_clouds(options[:cloud], "file list #{path}")
app.list_files(path)
rescue Client::NotFoundException => e
+ raise unless e.resource == :virtual_server
say_error e["message"]
rescue Client::ConflictException
say_error "Cloud #{app} wasn't deployed properly. Cannot list files."
end
desc "upload SOURCE_PATH [DEST_PATH]", "Upload files to persistent data storage"
def upload(source, destination = ".")
app = multiple_clouds(options[:cloud], "file upload #{source} #{destination}")
app.upload(source, destination)
rescue Client::NotFoundException => e
+ raise unless e.resource == :virtual_server
say_error e["message"]
rescue Client::ConflictException
say_error "Cloud #{app} wasn't deployed properly. Cannot upload files."
end
@@ -38,10 +40,11 @@
}
def download(relative_source = ".", destination = ".")
app = multiple_clouds(options[:cloud], "file download #{relative_source} #{destination}")
app.download(relative_source, destination)
rescue Client::NotFoundException => e
+ raise unless e.resource == :virtual_server
say_error e["message"]
rescue Client::ConflictException
say_error "Cloud #{app} wasn't deployed properly. Cannot download files."
end
@@ -56,9 +59,10 @@
exit 1 unless yes?(question)
end
app.delete_file(path)
rescue Client::NotFoundException => e
+ raise unless e.resource == :virtual_server
say_error e["message"]
rescue Client::ConflictException
say_error "Cloud #{app} wasn't deployed properly. Cannot delete files."
end