X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=snaps%2Ffile_utils.py;h=7b93a6dea4d6d0d0fe070232900df057c5fe93e9;hb=8d8af3c360b360c982b44ba343a97cf5949c8c20;hp=a321cc2cd50f1e598471375a608e3d8c2c60dc45;hpb=d1c4675e5c35257b84cd69969c6e67575faf19db;p=snaps.git diff --git a/snaps/file_utils.py b/snaps/file_utils.py index a321cc2..7b93a6d 100644 --- a/snaps/file_utils.py +++ b/snaps/file_utils.py @@ -42,21 +42,12 @@ def file_exists(file_path): return False -def get_file(file_path): - """ - Returns True if the image file has already been downloaded - :return: the image file object - :raise Exception when file cannot be found - """ - if file_exists(file_path): - return open(file_path, 'rb') - else: - raise Exception('File with path cannot be found - ' + file_path) - - def download(url, dest_path, name=None): """ Download a file to a destination path given a URL + :param url: the endpoint to the file to download + :param dest_path: the directory to save the file + :param name: the file name (optional) :rtype : File object """ if not name: