diff --git a/src/cli/oneimage b/src/cli/oneimage index 690e017180..546540bf9c 100755 --- a/src/cli/oneimage +++ b/src/cli/oneimage @@ -355,15 +355,15 @@ when "register", "create", "add" result=OpenNebula::Error.new("Can not read template: #{ARGV[0]}") end + if !is_successful?(result) + exit -1 + end + # Get the allocated image image=OpenNebula::Image.new_with_id(image.id, get_one_client) image.info template=image.to_hash template=template['IMAGE']['TEMPLATE'] - - if !is_successful?(result) - exit -1 - end # Perform the copy to the image repo if needed if template['PATH']