Add password parameter to the set_admin_password call in the compute api.

Updated servers password to use this parameter.
This commit is contained in:
Dan Prince
2011-03-09 14:53:44 -05:00
parent eadce208c5
commit a9bd1b4563
2 changed files with 5 additions and 3 deletions

View File

@@ -183,7 +183,8 @@ class Controller(wsgi.Controller):
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'])
self.compute_api.set_admin_password(context, server['server']['id'],
password)
return server
def update(self, req, id):

View File

@@ -498,9 +498,10 @@ class API(base.Base):
"""Unrescue the given instance."""
self._cast_compute_message('unrescue_instance', context, instance_id)
def set_admin_password(self, context, instance_id):
def set_admin_password(self, context, instance_id, password=None):
"""Set the root/admin password for the given instance."""
self._cast_compute_message('set_admin_password', context, instance_id)
self._cast_compute_message('set_admin_password', context, instance_id,
password)
def inject_file(self, context, instance_id):
"""Write a file to the given instance."""