From 34a25916646108454fac8dd490ae5d70eb7ce6bd Mon Sep 17 00:00:00 2001 From: Radostin Stoyanov Date: Mon, 26 Jun 2017 07:28:46 +0100 Subject: Raise exception if file source is invalid --- src/virtBootstrap/sources.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/virtBootstrap/sources.py b/src/virtBootstrap/sources.py index ca74313..6e54a96 100644 --- a/src/virtBootstrap/sources.py +++ b/src/virtBootstrap/sources.py @@ -211,6 +211,10 @@ class FileSource(object): @param dest: Directory path where the files to be extraced """ + + if not os.path.isfile(self.path): + raise Exception('Invalid file source "%s"' % self.path) + if self.output_format == 'dir': logging.info("Extracting files into destination directory") safe_untar(self.path, dest) -- cgit