1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-22 18:50:08 +03:00

Check if an given image is readable in oneimage.

When running "oneimage create --path .." the tool should check not only
for the existence but also for the readability of the given image.
If the image is unreadable (one user create the image an other tries to
upload it) the image will be created in ERROR state in the datastore.
This commit is contained in:
Matthias Schmitz 2015-03-26 22:57:33 +01:00
parent 5b80be0af6
commit d12333d542

View File

@ -86,10 +86,10 @@ class OneImageHelper < OpenNebulaHelper::OneHelper
path=Dir.pwd+"/"+o
end
if File.exist?(path)
if File.readable?(path)
[0, path]
else
[-1, "File '#{path}' does not exist."]
[-1, "File '#{path}' does not exist or is not readable."]
end
end
},