summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-01-25 15:20:08 +0000
committerGerrit Code Review <review@openstack.org>2012-01-25 15:20:08 +0000
commit30ac47bcbd8af06ed6a3ccdca552747c00381829 (patch)
tree5933eeadb4546cde8166d2098780d0804bd168cf /nova/api
parent99daaea663ade3839142f538427faa85d0e64c8f (diff)
parent2cf8b77c6933a5294c6f75591544651bee36c9a0 (diff)
Merge "blueprint host-aggregates: maintenance operations to host OSAPI exts"
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/compute/contrib/hosts.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/nova/api/openstack/compute/contrib/hosts.py b/nova/api/openstack/compute/contrib/hosts.py
index 6ee89859b..b522e6a98 100644
--- a/nova/api/openstack/compute/contrib/hosts.py
+++ b/nova/api/openstack/compute/contrib/hosts.py
@@ -53,6 +53,7 @@ class HostUpdateTemplate(xmlutil.TemplateBuilder):
root = xmlutil.TemplateElement('host')
root.set('host')
root.set('status')
+ root.set('maintenance_mode')
return xmlutil.MasterTemplate(root, 1)
@@ -128,15 +129,18 @@ class HostController(object):
# settings may follow.
if key == "status":
if val[:6] in ("enable", "disabl"):
- return self._set_enabled_status(req, id,
- enabled=(val.startswith("enable")))
+ enabled = val.startswith("enable")
else:
explanation = _("Invalid status: '%s'") % raw_val
raise webob.exc.HTTPBadRequest(explanation=explanation)
+ elif key == "maintenance_mode":
+ raise webob.exc.HTTPNotImplemented
else:
explanation = _("Invalid update setting: '%s'") % raw_key
raise webob.exc.HTTPBadRequest(explanation=explanation)
+ return self._set_enabled_status(req, id, enabled=enabled)
+
def _set_enabled_status(self, req, host, enabled):
"""Sets the specified host's ability to accept new instances."""
context = req.environ['nova.context']