From f601f62805e5e1aa02064279de0dacb0941847a4 Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Fri, 11 Mar 2016 10:11:36 -0600 Subject: [PATCH] Add backwards compat for server_kwargs name change 9eb7f644 changed the 'server_kwargs' argument of boot_and_delete_server_with_keypair to 'boot_server_kwargs', but didn't add any backwards compatibility for it. This adds the necessary compatibility in order to avoid breaking that scenario outright. Change-Id: I1083a48d2f0cfbedb8dc35df475857313fabfd8d --- rally/plugins/openstack/scenarios/nova/keypairs.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rally/plugins/openstack/scenarios/nova/keypairs.py b/rally/plugins/openstack/scenarios/nova/keypairs.py index ab20a629..7ebc67f9 100644 --- a/rally/plugins/openstack/scenarios/nova/keypairs.py +++ b/rally/plugins/openstack/scenarios/nova/keypairs.py @@ -13,6 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. +from rally.common import logging from rally import consts from rally.plugins.openstack import scenario from rally.plugins.openstack.scenarios.nova import utils @@ -57,8 +58,12 @@ class NovaKeypair(utils.NovaScenario): @validation.required_services(consts.Service.NOVA) @validation.required_openstack(users=True) @scenario.configure(context={"cleanup": ["nova"]}) + @logging.log_deprecated_args( + "'server_kwargs' has been renamed 'boot_server_kwargs'", + "0.3.2", ["server_kwargs"], once=True) def boot_and_delete_server_with_keypair(self, image, flavor, boot_server_kwargs=None, + server_kwargs=None, **kwargs): """Boot and delete server with keypair. @@ -72,10 +77,11 @@ class NovaKeypair(utils.NovaScenario): :param flavor: ID of the flavor to be used for server creation :param boot_server_kwargs: Optional additional arguments for VM creation + :param server_kwargs: Deprecated alias for boot_server_kwargs :param kwargs: Optional additional arguments for keypair creation """ - boot_server_kwargs = boot_server_kwargs or {} + boot_server_kwargs = boot_server_kwargs or server_kwargs or {} keypair = self._create_keypair(**kwargs) server = self._boot_server(image, flavor,