From bf7b89d577a9fbe8d25c3db2deae926d852d8bcc Mon Sep 17 00:00:00 2001 From: Brian Waldon Date: Thu, 10 Nov 2011 16:55:32 -0500 Subject: Converting inject_file to use instance objects Related to blueprint internal-uuids. This function also appeared to be incomplete. It should actually work now. Change-Id: I77ccd29c7ac5e0cbe60d52a4ff5a64ecdff6fa1a --- nova/compute/api.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'nova/compute') diff --git a/nova/compute/api.py b/nova/compute/api.py index 060dcd799..ab81dfbd7 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -1455,9 +1455,13 @@ class API(base.Base): {"method": "set_admin_password", "args": {"instance_id": instance_id, "new_pass": password}}) - def inject_file(self, context, instance_id): + @scheduler_api.reroute_compute("inject_file") + def inject_file(self, context, instance, path, file_contents): """Write a file to the given instance.""" - self._cast_compute_message('inject_file', context, instance_id) + instance_id = instance['id'] + params = {'path': path, 'file_contents': file_contents} + self._cast_compute_message('inject_file', context, + instance_id, params=params) def get_ajax_console(self, context, instance_id): """Get a url to an AJAX Console.""" -- cgit