From c920e3d5f38efd571efd84ea0f2ed80ba5fb60a8 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Mon, 23 Oct 2017 19:29:15 +0530 Subject: [PATCH 1/2] launcher: fix creation of snap2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When snap1 doesn't exist, `lxc-snapshot` will create a snapshot named `snap1` (instead of `snap2`). In this case we need to rename snap1 into snap2. However the condition check is wrong: after creating the snapshot, `snap1` will *always* exist – even if it didn't before. Thus the renaming never happens. Fix the issue by detecting the absence of snap2 (rather than snap1). --- sub_scripts/launcher.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sub_scripts/launcher.sh b/sub_scripts/launcher.sh index 1b14842..25a001f 100755 --- a/sub_scripts/launcher.sh +++ b/sub_scripts/launcher.sh @@ -84,7 +84,7 @@ create_temp_backup () { # lxc always creates the first snapshot it can creates. # So if snap1 doesn't exist and you try to create snap2, it will be named snap1. - if [ "$snap_number" == "2" ] && [ ! -e "$snapshot_path/snap1" ] + if [ "$snap_number" == "2" ] && [ ! -e "$snapshot_path/snap2" ] then # Rename snap1 to snap2 sudo mv "$snapshot_path/snap1" "$snapshot_path/snap2" From 2006e866358885f9bc58b8ee07a4a3d34f6cd993 Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Sun, 12 Nov 2017 22:50:03 +0100 Subject: [PATCH 2/2] Typo fix --- sub_scripts/launcher.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sub_scripts/launcher.sh b/sub_scripts/launcher.sh index 25a001f..1341375 100755 --- a/sub_scripts/launcher.sh +++ b/sub_scripts/launcher.sh @@ -78,7 +78,7 @@ create_temp_backup () { # Check if the snapshot already exist if [ ! -e "$snapshot_path/snap$snap_number" ] then - echo "snap$snap_number doesn't exist, its first creation can be take a little while." >&2 + echo "snap$snap_number doesn't exist, its first creation can takes a little while." >&2 # Create the snapshot. sudo lxc-snapshot --name $lxc_name >> "$test_result" 2>&1