diff options
author | Radostin Stoyanov <rstoyanov1@gmail.com> | 2017-06-26 07:28:46 +0100 |
---|---|---|
committer | Cédric Bosdonnat <cbosdonnat@suse.com> | 2017-06-28 11:46:26 +0200 |
commit | 34a25916646108454fac8dd490ae5d70eb7ce6bd (patch) | |
tree | 02296a9ce7b0e8eb4df3da71eece361bbad9febd /src/virtBootstrap/sources.py | |
parent | 1be26027e7b42cd65937ca185a106ce9139ba4c1 (diff) | |
download | virt-bootstrap.git-34a25916646108454fac8dd490ae5d70eb7ce6bd.tar.gz virt-bootstrap.git-34a25916646108454fac8dd490ae5d70eb7ce6bd.tar.xz virt-bootstrap.git-34a25916646108454fac8dd490ae5d70eb7ce6bd.zip |
Raise exception if file source is invalid
Diffstat (limited to 'src/virtBootstrap/sources.py')
-rw-r--r-- | src/virtBootstrap/sources.py | 4 |
1 files changed, 4 insertions, 0 deletions
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) |