From adcfd491308a98107e82b9f0595e0bf2f37b5a54 Mon Sep 17 00:00:00 2001 From: Brian Waldon Date: Wed, 21 Dec 2011 11:30:19 -0500 Subject: Allow accessIPv4 and accessIPv6 on rebuild action Fixes bug 893243 Change-Id: If320ead6f25613725faf6c01c4a87b496ef88961 --- nova/compute/api.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'nova/compute') diff --git a/nova/compute/api.py b/nova/compute/api.py index 6935a5ece..a4a47bc25 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -1194,25 +1194,22 @@ class API(base.Base): @check_instance_state(vm_state=[vm_states.ACTIVE], task_state=[None, task_states.RESIZE_VERIFY]) @scheduler_api.reroute_compute("rebuild") - def rebuild(self, context, instance, image_href, admin_password, - name=None, metadata=None, files_to_inject=None): - """Rebuild the given instance with the provided metadata.""" - name = name or instance["display_name"] - - files_to_inject = files_to_inject or [] - metadata = metadata or {} + def rebuild(self, context, instance, image_href, admin_password, **kwargs): + """Rebuild the given instance with the provided attributes.""" + files_to_inject = kwargs.pop('files_to_inject', []) self._check_injected_file_quota(context, files_to_inject) + + metadata = kwargs.get('metadata', {}) self._check_metadata_properties_quota(context, metadata) self.update(context, instance, - metadata=metadata, - display_name=name, image_ref=image_href, vm_state=vm_states.REBUILDING, task_state=None, - progress=0) + progress=0, + **kwargs) rebuild_params = { "new_pass": admin_password, -- cgit