diff options
| author | Chris Behrens <cbehrens@codestud.com> | 2011-05-26 19:30:23 +0000 |
|---|---|---|
| committer | Chris Behrens <cbehrens@codestud.com> | 2011-05-26 19:30:23 +0000 |
| commit | 4d8995813d070530f1b6aa4a8d07758cd7d74ec2 (patch) | |
| tree | 7a9ffe96e68b07459c08c2753cf54361d04a0a1d /nova/virt | |
| parent | 899642030dd60541153ccee810d082816f92dd49 (diff) | |
| parent | 146e3a7a4f38e17dfbdac12860cffa057c936ed4 (diff) | |
Merged trunk
Diffstat (limited to 'nova/virt')
| -rw-r--r-- | nova/virt/xenapi/vmops.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py index 02e140dcc..6d516ddbc 100644 --- a/nova/virt/xenapi/vmops.py +++ b/nova/virt/xenapi/vmops.py @@ -219,6 +219,13 @@ class VMOps(object): for path, contents in instance.injected_files: LOG.debug(_("Injecting file path: '%s'") % path) self.inject_file(instance, path, contents) + + def _set_admin_password(): + admin_password = instance.admin_pass + if admin_password: + LOG.debug(_("Setting admin password")) + self.set_admin_password(instance, admin_password) + # NOTE(armando): Do we really need to do this in virt? # NOTE(tr3buchet): not sure but wherever we do it, we need to call # reset_network afterwards @@ -231,6 +238,7 @@ class VMOps(object): LOG.debug(_('Instance %s: booted'), instance_name) timer.stop() _inject_files() + _set_admin_password() return True except Exception, exc: LOG.warn(exc) @@ -475,6 +483,9 @@ class VMOps(object): # Successful return code from password is '0' if resp_dict['returncode'] != '0': raise RuntimeError(resp_dict['message']) + db.instance_update(context.get_admin_context(), + instance['id'], + dict(admin_pass=new_pass)) return resp_dict['message'] def inject_file(self, instance, path, contents): |
