summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorDan Prince <dan.prince@rackspace.com>2011-03-09 21:24:56 +0000
committerTarmac <>2011-03-09 21:24:56 +0000
commita7a00129b1b91c8b66c73c9342ce541ec16f8570 (patch)
treef3eba5f1c6a71a22d01069dfea228dde945432e1 /nova/api
parent5662a822a013bd0d159c15b990231c4d1f12797f (diff)
parenta9bd1b456332aaf5f6ab9942979485f2192b6f3e (diff)
downloadnova-a7a00129b1b91c8b66c73c9342ce541ec16f8570.tar.gz
nova-a7a00129b1b91c8b66c73c9342ce541ec16f8570.tar.xz
nova-a7a00129b1b91c8b66c73c9342ce541ec16f8570.zip
Update the create server call in the Openstack API so that it generates an 'adminPass' and calls set_admin_password in the compute API. This gets us closer to parity with the Cloud Servers v1.0 spec.
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/servers.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py
index 85999764f..41166f810 100644
--- a/nova/api/openstack/servers.py
+++ b/nova/api/openstack/servers.py
@@ -98,7 +98,7 @@ class Controller(wsgi.Controller):
'application/xml': {
"attributes": {
"server": ["id", "imageId", "name", "flavorId", "hostId",
- "status", "progress"]}}}
+ "status", "progress", "adminPass"]}}}
def __init__(self):
self.compute_api = compute.API()
@@ -178,7 +178,14 @@ class Controller(wsgi.Controller):
key_data=key_pair['public_key'],
metadata=metadata,
onset_files=env.get('onset_files', []))
- return _translate_keys(instances[0])
+
+ server = _translate_keys(instances[0])
+ password = "%s%s" % (server['server']['name'][:4],
+ utils.generate_password(12))
+ server['server']['adminPass'] = password
+ self.compute_api.set_admin_password(context, server['server']['id'],
+ password)
+ return server
def update(self, req, id):
""" Updates the server name or password """