aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mageia.org>2012-08-08 19:38:11 +0000
committerPascal Terjan <pterjan@mageia.org>2012-08-08 19:38:11 +0000
commit81e59bc9e315564ab89134c3bc496d20b0935157 (patch)
tree17dbb8d9d20c32a5dcc06bce205708497ef59fdd /lib
parent546f69e7769a949e75b8cc8292684c3155f51c29 (diff)
downloadiurt-81e59bc9e315564ab89134c3bc496d20b0935157.tar
iurt-81e59bc9e315564ab89134c3bc496d20b0935157.tar.gz
iurt-81e59bc9e315564ab89134c3bc496d20b0935157.tar.bz2
iurt-81e59bc9e315564ab89134c3bc496d20b0935157.tar.xz
iurt-81e59bc9e315564ab89134c3bc496d20b0935157.zip
Check return codes when creating btrfs subvolumes or snapshots
Diffstat (limited to 'lib')
-rw-r--r--lib/Iurt/Chroot.pm11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/Iurt/Chroot.pm b/lib/Iurt/Chroot.pm
index 37ea892..7b75274 100644
--- a/lib/Iurt/Chroot.pm
+++ b/lib/Iurt/Chroot.pm
@@ -341,17 +341,18 @@ sub create_build_chroot_btrfs {
if (check_chroot_need_update($chroot_ref, $run)) {
sudo($config, '--btrfs_delete', $chroot_ref);
- sudo($config, '--btrfs_create', $chroot_ref); # Check !
+ if (!sudo($config, '--btrfs_create', $chroot_ref)) {
+ plog('ERROR', "creating btrfs subvolume failed.");
+ return;
+ }
if (!build_chroot($run, $config, $chroot_ref)) {
- plog('NOTIFY', "creating chroot failed.");
+ plog('ERROR', "creating chroot failed.");
sudo($config, '--btrfs_delete', $chroot_ref);
return;
}
}
- sudo($config, '--btrfs_snapshot', $chroot_ref, $chroot); # Check !
-
- 1;
+ sudo($config, '--btrfs_snapshot', $chroot_ref, $chroot);
}
sub build_chroot {