summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2014-09-29 22:14:03 +0000
committerGerrit Code Review <review@openstack.org>2014-09-29 22:14:03 +0000
commit651ef4d0019951da106c0dbb2cad22a3bd0bdd52 (patch)
tree69e71a13132635779e62c0a337e198758416ee8c
parent2a6b9c5ae0371bcc8384bfd18497617dd6a1725f (diff)
parent583d12f4fae620719b893cb7f9fbfc461ec8a124 (diff)
downloadnova-651ef4d0019951da106c0dbb2cad22a3bd0bdd52.tar.gz
Merge "VMware: Remove tests for None in fake._db_content['files']"
-rw-r--r--nova/exception.py4
-rw-r--r--nova/tests/virt/vmwareapi/fake.py8
2 files changed, 0 insertions, 12 deletions
diff --git a/nova/exception.py b/nova/exception.py
index bfeae94457..524df41f36 100644
--- a/nova/exception.py
+++ b/nova/exception.py
@@ -1081,10 +1081,6 @@ class FileNotFound(NotFound):
msg_fmt = _("File %(file_path)s could not be found.")
-class NoFilesFound(NotFound):
- msg_fmt = _("Zero files could be found.")
-
-
class SwitchNotFoundForNetworkAdapter(NotFound):
msg_fmt = _("Virtual switch associated with the "
"network adapter %(adapter)s not found.")
diff --git a/nova/tests/virt/vmwareapi/fake.py b/nova/tests/virt/vmwareapi/fake.py
index abd7c91bf0..ca0b44c907 100644
--- a/nova/tests/virt/vmwareapi/fake.py
+++ b/nova/tests/virt/vmwareapi/fake.py
@@ -962,8 +962,6 @@ def _add_file(file_path):
def _remove_file(file_path):
"""Removes a file reference from the db."""
- if _db_content.get("files") is None:
- raise exception.NoFilesFound()
# 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"):
@@ -991,8 +989,6 @@ def fake_get_network(*args, **kwargs):
def get_file(file_path):
"""Check if file exists in the db."""
- if _db_content.get("files") is None:
- raise exception.NoFilesFound()
return file_path in _db_content.get("files")
@@ -1308,8 +1304,6 @@ class FakeVim(object):
"""Searches the datastore for a file."""
# TODO(garyk): add support for spec parameter
ds_path = kwargs.get("datastorePath")
- if _db_content.get("files", None) is None:
- raise exception.NoFilesFound()
matched_files = set()
# Check if we are searching for a file or a directory
directory = False
@@ -1373,8 +1367,6 @@ class FakeVim(object):
def _make_dir(self, method, *args, **kwargs):
"""Creates a directory in the datastore."""
ds_path = kwargs.get("name")
- if _db_content.get("files", None) is None:
- raise exception.NoFilesFound()
if get_file(ds_path):
raise vexc.FileAlreadyExistsException()
_db_content["files"].append('%s/' % ds_path)