Repository: ansible/ansible

Issue:
aci_static_binding_to_epg module prepending "eth" to interface_type: port_channel
<!---
Verify first that your issue/request is not already reported on GitHub.
Also test if the latest release, and devel branch are affected too.
Always add information AFTER of these html comments.
-->

##### ISSUE TYPE
<!--- Pick one below and delete the rest -->
 - Bug Report


##### COMPONENT NAME
<!---
Insert below this comment the name of the module, plugin, task or feature.
Do not include extra details here, e.g. "vyos_command" not "the network module vyos_command" or the full path
-->
aci_static_binding_to_epg
##### ANSIBLE VERSION
<!--- Paste verbatim output from "ansible --version" between quotes below -->
```
ansible 2.5.0
  config file = None
  configured module search path = [u'/u/mtorelli/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /u/mtorelli/gitlab/gdl2_refresh/venv_2_5/lib/python2.7/site-packages/ansible
  executable location = /u/mtorelli/gitlab/gdl2_refresh/venv_2_5/bin/ansible
  python version = 2.7.5 (default, May  3 2017, 07:55:04) [GCC 4.8.5 20150623 (Red Hat 4.8.5-14)]
```

##### CONFIGURATION
<!---
If using Ansible 2.4 or above, paste the results of "ansible-config dump --only-changed"
Otherwise, mention any settings you have changed/added/removed in ansible.cfg
(or using the ANSIBLE_* environment variables).
-->

##### OS / ENVIRONMENT
<!---
Mention the OS you are running Ansible from, and the OS you are
managing, or say "N/A" for anything that is not platform-specific.
Also mention the specific version of what you are trying to control,
e.g. if this is a network bug the version of firmware on the network device.
-->
Red Hat Enterprise Linux Server release 7.4 (Maipo)
Cisco APIC version 3.1(2m)
##### SUMMARY
<!--- Explain the problem briefly -->
In the INTERFACE_TYPE_MAPPING dictionary, for interface type port_channel, the code is prepending 'eth' to the interface parameter (i.e., the policy-group name) 

port_channel='topology/pod-{0}/paths-{1}/pathep-[eth{2}]'.format(pod_id, leafs, interface), 
##### STEPS TO REPRODUCE
<!---
For bugs, show exactly how to reproduce the problem, using a minimal test-case.
For new features, show how the feature would be used.
-->
Just run the playbook task below after creating the tenant, app profile and epg on the apic.
<!--- Paste example playbooks or commands between quotes below -->
```yaml
---

- name: Adding static path for port TEST-POLICY-GROUP (vlan-2690) on node 217 in TENANT/DATA/Vlan2690
  aci_static_binding_to_epg:
    hostname: "{{ apic_hostname }}"
    username: "{{ apic_username }}"
    password: "{{ apic_password }}"
    use_ssl: yes
    validate_certs: no
    tenant: TENANT
    ap: DATA
    epg: Vlan2690
    leafs: 217
    pod_id: 1
    interface: TEST-POLICY-GROUP
    interface_type: port_channel
    interface_mode: untagged
    encap_id: 2690
    state: present
```

<!--- You can also paste gist.github.com links for larger files -->

##### EXPECTED RESULTS
<!--- What did you expect to happen when running the steps above? -->
the module should create  the static port 
Pod1/Node-217/TEST-POLICY-GROUP
##### ACTUAL RESULTS
<!--- What actually happened? If possible run with extra verbosity (-vvvv) -->
the module creates the static port 
Pod1/Node-217/ethTEST-POLICY-GROUP
<!--- Paste verbatim command output between quotes below -->
```

```



Discussion:
Files identified in the description:
* [lib/ansible/modules/network/aci/aci_static_binding_to_epg.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/network/aci/aci_static_binding_to_epg.py)

If these files are inaccurate, please update the `component name` section of the description or use the `!component` bot command.

[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)
<!--- boilerplate: components_banner --->
cc @brunocalogero @dagwieers @jmcgill298 @schunduri
[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)
<!--- boilerplate: notify --->

Resolving patch:
diff --git a/lib/ansible/modules/network/aci/aci_static_binding_to_epg.py b/lib/ansible/modules/network/aci/aci_static_binding_to_epg.py
--- a/lib/ansible/modules/network/aci/aci_static_binding_to_epg.py
+++ b/lib/ansible/modules/network/aci/aci_static_binding_to_epg.py
@@ -340,7 +340,7 @@ def main():
 
     INTERFACE_TYPE_MAPPING = dict(
         fex='topology/pod-{0}/paths-{1}/extpaths-{2}/pathep-[eth{3}]'.format(pod_id, leafs, extpaths, interface),
-        port_channel='topology/pod-{0}/paths-{1}/pathep-[eth{2}]'.format(pod_id, leafs, interface),
+        port_channel='topology/pod-{0}/paths-{1}/pathep-[{2}]'.format(pod_id, leafs, interface),
         switch_port='topology/pod-{0}/paths-{1}/pathep-[eth{2}]'.format(pod_id, leafs, interface),
         vpc='topology/pod-{0}/protpaths-{1}/pathep-[{2}]'.format(pod_id, leafs, interface),
     )


Test patch: