diff --git a/src/oca/ec2/econe-server b/src/oca/ec2/econe-server index 94fd91e630..4b2bdbe500 100755 --- a/src/oca/ec2/econe-server +++ b/src/oca/ec2/econe-server @@ -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 & diff --git a/src/oca/rm/image.rb b/src/oca/rm/image.rb index f1ce5ede6a..f7cfcb05ec 100644 --- a/src/oca/rm/image.rb +++ b/src/oca/rm/image.rb @@ -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