Skip to content

Commit

Permalink
Fix #85. image_provision tries to remove wrong snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
churchers committed May 12, 2016
1 parent ea0e02a commit 9119310
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/vm-zfs
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ __zfs_image_create(){
#
__zfs_image_provision(){
local _uuid="$1"
local _snap="${_uuid%%-*}"
local _name="$2"
local _file _oldname _entry _num=0

Expand All @@ -402,7 +403,7 @@ __zfs_image_provision(){
[ $? -ne 0 ] && __err "errors occured while trying to unpackage the image file"

# remove the original snapshot
zfs destroy "${VM_ZFS_DATASET}/${_name}@${_uuid}" >/dev/null 2>&1
zfs destroy "${VM_ZFS_DATASET}/${_name}@${_snap}" >/dev/null 2>&1

# rename the guest configuration file
mv "${vm_dir}/${_name}/${_oldname}.conf" "${vm_dir}/${_name}/${_name}.conf" >/dev/null 2>&1
Expand Down
4 changes: 2 additions & 2 deletions vm
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

VERSION=1.0-p2
VERSION_INT=100010
VERSION=1.0-p3
VERSION_INT=100011
VERSION_BSD=$(uname -K)
PATH=${PATH}:/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin

Expand Down

0 comments on commit 9119310

Please sign in to comment.