summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorEd Leafe <ed@leafe.com>2011-01-14 07:49:41 +0000
committerTarmac <>2011-01-14 07:49:41 +0000
commit9fb1e7b1f627b10fda1249754e4bc612d697110c (patch)
tree0876e5de69ff6d0f0c40a93759f939081c65c451 /nova/api
parent8a4eb03ec32144381e8defa791e923675a1c2314 (diff)
parent01a1ad3d2cdf61c73ca3ab7aa14e82f0e4450103 (diff)
downloadnova-9fb1e7b1f627b10fda1249754e4bc612d697110c.tar.gz
nova-9fb1e7b1f627b10fda1249754e4bc612d697110c.tar.xz
nova-9fb1e7b1f627b10fda1249754e4bc612d697110c.zip
Implements the blueprint for enabling the setting of the root/admin password on an instance.
It uses a new xenapi plugin 'agent' that handles communication to/from the agent running on the guest.
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/servers.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py
index 29af82533..8cbcebed2 100644
--- a/nova/api/openstack/servers.py
+++ b/nova/api/openstack/servers.py
@@ -165,15 +165,18 @@ class Controller(wsgi.Controller):
if not inst_dict:
return faults.Fault(exc.HTTPUnprocessableEntity())
+ ctxt = req.environ['nova.context']
update_dict = {}
if 'adminPass' in inst_dict['server']:
update_dict['admin_pass'] = inst_dict['server']['adminPass']
+ try:
+ self.compute_api.set_admin_password(ctxt, id)
+ except exception.TimeoutException, e:
+ return exc.HTTPRequestTimeout()
if 'name' in inst_dict['server']:
update_dict['display_name'] = inst_dict['server']['name']
-
try:
- self.compute_api.update(req.environ['nova.context'], id,
- **update_dict)
+ self.compute_api.update(ctxt, id, **update_dict)
except exception.NotFound:
return faults.Fault(exc.HTTPNotFound())
return exc.HTTPNoContent()