From 3b8ef1b88abe01b9b7510d8a0cd4179e3f0e59d5 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Tue, 18 Apr 2017 11:13:02 -0500 Subject: [PATCH] Actually fix the app_name protection The previous "fix" just disabled the app_name protection for python3. Go with Jens' suggestion (the easy route) of trying, and if that doesn't work, retrying. Change-Id: Ie4d1091b0f1fc6e1c9d9a2c935a458ea5ce55af3 --- shade/__init__.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/shade/__init__.py b/shade/__init__.py index 568ba868d..615987fee 100644 --- a/shade/__init__.py +++ b/shade/__init__.py @@ -34,18 +34,11 @@ if requestsexceptions.SubjectAltNameWarning: def _get_openstack_config(app_name=None, app_version=None): # Protect against older versions of os-client-config that don't expose this - kwargs = {} try: - init = os_client_config.OpenStackConfig.__init__ - if 'app_name' in init.im_func.func_code.co_varnames: - kwargs['app_name'] = app_name - kwargs['app_version'] = app_version - except AttributeError: - # If we get an attribute error, it's actually likely some mocking issue - # but basically nothing about this is important enough to break things - # for someone. - pass - return os_client_config.OpenStackConfig(**kwargs) + return os_client_config.OpenStackConfig( + app_name=app_name, app_version=app_version) + except Exception: + return os_client_config.OpenStackConfig() def simple_logging(debug=False, http_debug=False):