From d3d36eb7660ce27fc76c94df1f8d468c5e0aafa7 Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Mon, 9 Nov 2015 09:36:17 -0500 Subject: [PATCH] fixes conditional statement for py24 compatibility --- lib/ansible/module_utils/nxapi.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ansible/module_utils/nxapi.py b/lib/ansible/module_utils/nxapi.py index 150620d65ff..04499c8a3ea 100644 --- a/lib/ansible/module_utils/nxapi.py +++ b/lib/ansible/module_utils/nxapi.py @@ -77,7 +77,10 @@ def nxapi_argument_spec(spec=None): def nxapi_url(module): """Constructs a valid NXAPI url """ - proto = 'https' if module.params['use_ssl'] else 'http' + if module.params['use_ssl']: + proto = 'https' + else: + proto = 'http' host = module.params['host'] url = '{}://{}'.format(proto, host) port = module.params['port']