diff options
| author | Justin Santa Barbara <justin@fathomdb.com> | 2011-03-22 21:42:17 -0700 |
|---|---|---|
| committer | Justin Santa Barbara <justin@fathomdb.com> | 2011-03-22 21:42:17 -0700 |
| commit | 365b98f4d52740ef85f8a8f098a32e441d7ac168 (patch) | |
| tree | 1fe7b7605ec6da172ddf8e77943382a24267af08 | |
| parent | 9dce9ee5fe5a1df018b9a606a3ea35b2dbfc987e (diff) | |
Renamed check_instance -> check_isinstance to make intent clearer
| -rw-r--r-- | nova/utils.py | 2 | ||||
| -rw-r--r-- | nova/virt/connection.py | 2 | ||||
| -rw-r--r-- | nova/virt/fake.py | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/nova/utils.py b/nova/utils.py index e93f489be..2e653bda0 100644 --- a/nova/utils.py +++ b/nova/utils.py @@ -587,7 +587,7 @@ def get_from_path(items, path): return get_from_path(results, remainder) -def check_instance(obj, cls): +def check_isinstance(obj, cls): """Checks that obj is of type cls, and lets PyLint infer types""" if isinstance(obj, cls): return obj diff --git a/nova/virt/connection.py b/nova/virt/connection.py index d585b6c21..4ba31c7a7 100644 --- a/nova/virt/connection.py +++ b/nova/virt/connection.py @@ -74,4 +74,4 @@ def get_connection(read_only=False): if conn is None: LOG.error(_('Failed to open connection to the hypervisor')) sys.exit(1) - return utils.check_instance(conn, driver.ComputeDriver) + return utils.check_isinstance(conn, driver.ComputeDriver) diff --git a/nova/virt/fake.py b/nova/virt/fake.py index e0e2369c7..57b02e00b 100644 --- a/nova/virt/fake.py +++ b/nova/virt/fake.py @@ -100,7 +100,7 @@ class FakeConnection(driver.ComputeDriver): return self.instances.keys() def _map_to_instance_info(self, instance): - instance = utils.check_instance(instance, FakeInstance) + instance = utils.check_isinstance(instance, FakeInstance) info = driver.InstanceInfo(instance.name, instance.state) return info |
