Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eos_lag_interfaces name parameter requires 'Port-Channel' in the name despite documentation stating otherwise #79

Closed
sc68cal opened this issue Jul 7, 2020 · 1 comment · Fixed by #80

Comments

@sc68cal
Copy link
Contributor

sc68cal commented Jul 7, 2020

The documentation for eos_lag_interfaces has examples such as

- name: Override all device configuration of all LAG attributes with provided configuration
  eos_lag_interfaces:
    config:
      - name: 10
        members:
          - member: Ethernet2
            mode: on
    state: overridden

However, the code that actually appears to implement this, uses the 12th letter of the name parameter, forward.

So following the documentation, you end up with an error because if you create a name of just 10 like the documentation states, channel_id turns into an empty string, which yields flawed commands and results in an error

ansible.module_utils.connection.ConnectionError: channel-group  mode on% Invalid input

Manaully fixing this by doing

- name: Override all device configuration of all LAG attributes with provided configuration
  eos_lag_interfaces:
    config:
      - name: Port-Channel10
        members:
          - member: Ethernet2
            mode: on
    state: overridden

Corrects this issue.

So which is the correct fix? Documentation fix, or better code?

sc68cal added a commit to sc68cal/arista.eos that referenced this issue Jul 7, 2020
sc68cal added a commit to sc68cal/arista.eos that referenced this issue Jul 7, 2020
@sc68cal sc68cal changed the title eos_lag_interfaces documentation mismatch eos_lag_interfaces name parameter requires 'Port-Channel' in the name despite documentation stating otherwise Jul 7, 2020
@sc68cal
Copy link
Contributor Author

sc68cal commented Jul 7, 2020

I have pushed a patch with code that handles both cases where only integer digits are passed to the name, as well as Port-Channel<digits>

sc68cal added a commit to sc68cal/arista.eos that referenced this issue Jul 8, 2020
sc68cal added a commit to sc68cal/arista.eos that referenced this issue Jul 8, 2020
sc68cal added a commit to sc68cal/arista.eos that referenced this issue Jul 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant