From 0daebe727246eef501c54adaa678995467e3060b Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Tue, 23 Oct 2012 12:44:54 -0700 Subject: Add virt driver capabilities definition Going forward with the early stages of no-db-compute, we will consistently hit cases where we need to eject some database usage from one virt driver up a few layers. Since those are not commonly used by all, some way of determining (and the higher layer) the properties of the virt driver being used will be useful. We have discussed using something like a mixin interface class and multiple inheritance. We have discussed tricks like detecting if the manage_image_cache() method has been overridden. We have discussed trying it once and catching NotImplementedError and then never trying again. Aside from the first, none of these are unsneaky enough to bite us later. This approach will provide us a way to declare such properties succinctly in the compute driver to help the higher layers know what we want them to do on our behalf. Change-Id: I74dea9322a5b4688319ebf5d9afe416e93401c58 --- nova/compute/manager.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'nova/compute') diff --git a/nova/compute/manager.py b/nova/compute/manager.py index f598ccb39..515737992 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -2970,6 +2970,8 @@ class ComputeManager(manager.SchedulerDependentManager): def _run_image_cache_manager_pass(self, context): """Run a single pass of the image cache manager.""" + if not self.driver.capabilities["has_imagecache"]: + return if FLAGS.image_cache_manager_interval == 0: return -- cgit