From 2cd8a3a9a31ab6f6fe58462030e097dd6a022a7b Mon Sep 17 00:00:00 2001 From: Dag Wieers Date: Sat, 20 Jan 2018 02:47:28 +0100 Subject: [PATCH] ACI: Make network testing work out-of-the-box (#35116) --- lib/ansible/module_utils/network/aci/aci.py | 4 ++-- test/integration/inventory | 8 ++++++++ test/integration/target-prefixes.network | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/ansible/module_utils/network/aci/aci.py b/lib/ansible/module_utils/network/aci/aci.py index 89df5f4f3ed..4823d294f72 100644 --- a/lib/ansible/module_utils/network/aci/aci.py +++ b/lib/ansible/module_utils/network/aci/aci.py @@ -189,9 +189,9 @@ class ACIModule(object): ''' Set protocol based on use_ssl parameter ''' # Set protocol for further use - if self.params['protocol'] in ('http', 'https'): + if 'protocol' in self.params and self.params['protocol'] in ('http', 'https'): self.module.deprecate("Parameter 'protocol' is deprecated, please use 'use_ssl' instead.", '2.6') - elif self.params['protocol'] is None: + elif 'protocol' not in self.params or self.params['protocol'] is None: self.params['protocol'] = 'https' if self.params.get('use_ssl', True) else 'http' else: self.module.fail_json(msg="Parameter 'protocol' needs to be one of ( http, https )") diff --git a/test/integration/inventory b/test/integration/inventory index 3b53217928d..92d7dc7c747 100644 --- a/test/integration/inventory +++ b/test/integration/inventory @@ -48,6 +48,14 @@ groups_tree_var=3000 grandparent_var=2000 overridden_in_parent=2000 +[aci:vars] +aci_hostname=your-apic-1 +aci_username=admin +aci_password=your-password + +[aci] +localhost ansible_ssh_host=127.0.0.1 ansible_connection=local + [amazon] localhost ansible_ssh_host=127.0.0.1 ansible_connection=local diff --git a/test/integration/target-prefixes.network b/test/integration/target-prefixes.network index 546e5eea779..0efe28c6fd2 100644 --- a/test/integration/target-prefixes.network +++ b/test/integration/target-prefixes.network @@ -1,4 +1,5 @@ a10 +aci asa bigip cl