Skip to content

Commit cc5c005

Browse files
committed
[ignore] change logic for aci_vmm_vswitch_policy to leverage the VM_PROVIDER constant
1 parent f484d91 commit cc5c005

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

plugins/modules/aci_vmm_vswitch_policy.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -302,18 +302,10 @@
302302
from ansible.module_utils.basic import AnsibleModule
303303
from ansible_collections.cisco.aci.plugins.module_utils.aci import ACIModule, aci_argument_spec, enhanced_lag_spec, netflow_spec
304304
from ansible_collections.cisco.aci.plugins.module_utils.aci import aci_annotation_spec, aci_owner_spec
305+
from ansible_collections.cisco.aci.plugins.module_utils.constants import VM_PROVIDER_MAPPING
305306

306307
# via UI vSwitch Policy can only be added for VMware and Microsoft vmm domains
307308
# behavior for other domains is currently untested.
308-
VM_PROVIDER_MAPPING = dict(
309-
cloudfoundry="CloudFoundry",
310-
kubernetes="Kubernetes",
311-
microsoft="Microsoft",
312-
openshift="OpenShift",
313-
openstack="OpenStack",
314-
redhat="Redhat",
315-
vmware="VMware",
316-
)
317309

318310
# enhanced_lag_spec = dict(
319311
# name=dict(type='str', required=True),
@@ -336,6 +328,9 @@
336328

337329

338330
def main():
331+
# Remove nutanix from VM_PROVIDER_MAPPING as it is not supported
332+
VM_PROVIDER_MAPPING.pop("nutanix")
333+
339334
argument_spec = aci_argument_spec()
340335
argument_spec.update(aci_annotation_spec())
341336
argument_spec.update(aci_owner_spec())
@@ -349,7 +344,7 @@ def main():
349344
netflow_exporter=dict(type="dict", options=netflow_spec()),
350345
domain=dict(type="str", aliases=["domain_name", "domain_profile"]),
351346
state=dict(type="str", default="present", choices=["absent", "present", "query"]),
352-
vm_provider=dict(type="str", choices=list(VM_PROVIDER_MAPPING.keys())),
347+
vm_provider=dict(type="str", choices=list(VM_PROVIDER_MAPPING)),
353348
)
354349

355350
module = AnsibleModule(

0 commit comments

Comments
 (0)