[gnome-boxes] unattended-file: Ensure DISK injection method is supported
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes] unattended-file: Ensure DISK injection method is supported
- Date: Fri, 1 Aug 2014 10:45:48 +0000 (UTC)
commit 789600cba888e82407b7e2cbc4d0c3dc54195d21
Author: Lasse Schuirmann <lasse schuirmann gmail com>
Date: Sun Jul 20 16:20:54 2014 +0200
unattended-file: Ensure DISK injection method is supported
Prior to this, injection methods were just assumed to be DISK. We should
check if it actually is supported before using it.
https://bugzilla.gnome.org/show_bug.cgi?id=730640
src/unattended-file.vala | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/unattended-file.vala b/src/unattended-file.vala
index 24f5b22..8b83ebb 100644
--- a/src/unattended-file.vala
+++ b/src/unattended-file.vala
@@ -97,10 +97,17 @@ private class Boxes.UnattendedScriptFile : GLib.Object, Boxes.UnattendedFile {
private File unattended_tmp;
- public UnattendedScriptFile (UnattendedInstaller installer, InstallScript script, string dest_name) {
+ public UnattendedScriptFile (UnattendedInstaller installer,
+ InstallScript script,
+ string dest_name)
+ throws GLib.Error {
this.installer = installer;
this.script = script;
this.dest_name = dest_name;
+
+ var injection_methods = script.get_injection_methods ();
+ if (!(InstallScriptInjectionMethod.DISK in injection_methods))
+ throw new GLib.IOError.NOT_SUPPORTED ("No supported injection method available.");
}
~UnattendedScriptFile () {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]