summaryrefslogtreecommitdiffstats
path: root/nova/compute
diff options
context:
space:
mode:
authorEd Leafe <ed@leafe.com>2011-07-01 14:26:05 +0000
committerEd Leafe <ed@leafe.com>2011-07-01 14:26:05 +0000
commitfb6aba61ef03032c31196bd58c68fa7b7d4c2769 (patch)
treeedf5f32bd90eb283d4cc3c57cc14f21fb95559f9 /nova/compute
parent7ca20797496947c0bdd60e77b4962fd360e01f55 (diff)
completed api changes. still need plugin changes
Diffstat (limited to 'nova/compute')
-rw-r--r--nova/compute/api.py13
-rw-r--r--nova/compute/manager.py12
2 files changed, 8 insertions, 17 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py
index 4dba6cf1f..c99b64c50 100644
--- a/nova/compute/api.py
+++ b/nova/compute/api.py
@@ -912,15 +912,10 @@ class API(base.Base):
"""Unpause the given instance."""
self._cast_compute_message('unpause_instance', context, instance_id)
- def disable_host(self, context, instance_id=None, host=None):
- """Sets the specified to not receive new instances."""
- return self._call_compute_message("disable_host", context,
- instance_id=None, host=host)
-
- def enable_host(self, context, instance_id=None, host=None):
- """Sets the specified to receive new instances."""
- return self._call_compute_message("enable_host", context,
- instance_id=None, host=host)
+ def set_host_enabled(self, context, host, enabled):
+ """Sets the specified host's ability to accept new instances."""
+ return self._call_compute_message("set_host_enabled", context,
+ instance_id=None, host=host, enabled=enabled)
@scheduler_api.reroute_compute("diagnostics")
def get_diagnostics(self, context, instance_id):
diff --git a/nova/compute/manager.py b/nova/compute/manager.py
index 152b2670c..91a604934 100644
--- a/nova/compute/manager.py
+++ b/nova/compute/manager.py
@@ -875,14 +875,10 @@ class ComputeManager(manager.SchedulerDependentManager):
result))
@exception.wrap_exception
- def disable_host(self, context, instance_id=None, host=None):
- """Set a host so that it can not accept new instances."""
- return self.driver.disable_host(host)
-
- @exception.wrap_exception
- def enable_host(self, context, instance_id=None, host=None):
- """Set a host so that it can accept new instances."""
- return self.driver.enable_host(host)
+ def set_host_enabled(self, context, instance_id=None, host=None,
+ enabled=None):
+ """Sets the specified host's ability to accept new instances."""
+ return self.driver.set_host_enabled(host, enabled)
@exception.wrap_exception
def get_diagnostics(self, context, instance_id):