mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-16 22:50:10 +03:00
Changed tmp dir and oc moves images instead of copying
git-svn-id: http://svn.opennebula.org/one/trunk@736 3034c82b-c49b-4eb3-8279-a7acafdc01c0
This commit is contained in:
parent
c71b443f8d
commit
c5cc2c2269
@ -1,5 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
eval `grep ^IMAGE_DIR= $ONE_LOCATION/etc/oca.conf `
|
||||
export TMPDIR=$IMG_DIR/tmp
|
||||
mkdir -p $TMPDIR
|
||||
|
||||
nohup ruby $ONE_LOCATION/lib/ruby/econe/eco.rb >> $ONE_LOCATION/var/econe.log &
|
||||
|
||||
|
||||
|
@ -61,7 +61,8 @@ module OpenNebula
|
||||
|
||||
image=Image.new(data)
|
||||
|
||||
image.copy_image(path)
|
||||
# TODO: make copy or movement configurable
|
||||
image.copy_image(path, true)
|
||||
image.get_image_info
|
||||
image.save
|
||||
|
||||
@ -77,8 +78,12 @@ module OpenNebula
|
||||
# Copies the image from the source path to the image repository.
|
||||
# Its name will be the image uuid. It also stores its new location
|
||||
# in the object.
|
||||
def copy_image(path)
|
||||
FileUtils.cp(path, image_path)
|
||||
def copy_image(path, move=false)
|
||||
if move
|
||||
FileUtils.mv(path, image_path)
|
||||
else
|
||||
FileUtils.cp(path, image_path)
|
||||
end
|
||||
self.path=image_path
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user