VMware: Fix fake raising the wrong exception in _remove_file

fake was raising exception.FileNotFound error if a file was not found.
However, an actual delete on a non-existent file raises the error
returned by vSphere, which is error_util.FileNotFoundException. This
breaks tests which exercise error paths expecting the real error to be
raised.

Fortunately this change doesn't break any existing tests. However, I'm
not sure that's a good thing.

This change is required to enable a test in change
I3df3d614656e511c909b6c1837582c0d34bf84c6.

Change-Id: I2025bffa887582eaa9e9072d0400f90ca97d1898
(cherry picked from commit 529b5ab2e1)
This commit is contained in:
Matthew Booth 2014-06-26 14:45:40 +01:00
parent 678b00e028
commit 0142324b2f
1 changed files with 1 additions and 1 deletions

View File

@ -914,7 +914,7 @@ def _remove_file(file_path):
# Check if the remove is for a single file object or for a folder
if file_path.find(".vmdk") != -1:
if file_path not in _db_content.get("files"):
raise exception.FileNotFound(file_path=file_path)
raise error_util.FileNotFoundException(file_path)
_db_content.get("files").remove(file_path)
else:
# Removes the files in the folder and the folder too from the db