From a23451831ee7601fee3aba519125f028bbc1c9d9 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Sat, 11 Oct 2014 10:33:38 -0700 Subject: [PATCH] Plumb through a small name change for args We want to be able to sanely and safely passthrough args lists from consumers. "name" is a very common thing to want to also be in a consuming args list, whereas "cloud" is clearly something we own. --- shade/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/shade/__init__.py b/shade/__init__.py index a1a49c884..476897d33 100644 --- a/shade/__init__.py +++ b/shade/__init__.py @@ -56,9 +56,9 @@ def openstack_clouds(config=None): for f in config.get_all_clouds()] -def openstack_cloud(cloud='openstack', region=None): +def openstack_cloud(**kwargs): cloud_config = os_client_config.OpenStackConfig().get_one_cloud( - cloud, region) + **kwargs) return OpenStackCloud( cloud_config.name, cloud_config.region, **cloud_config.config) @@ -70,11 +70,11 @@ def _get_service_values(kwargs, service_key): class OpenStackCloud(object): - def __init__(self, name, region='', + def __init__(self, cloud, region='', image_cache=None, flavor_cache=None, volume_cache=None, debug=False, **kwargs): - self.name = name + self.name = cloud self.region = region self.username = kwargs['username']