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

op-cmd: T5802: bug fix for "ping x.x.x.x interface" completion options #2594

Merged
merged 1 commit into from Dec 8, 2023

Conversation

srividya0208
Copy link
Contributor

Change Summary

this fix will provide a list of interfaces for the possible completions of ping command with interface option

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

Related PR(s)

Component(s) name

ping

Proposed changes

Before:

vyos@R1:~$ ping 8.8.8.8 interface Traceback (most recent call last):
  File "/usr/libexec/vyos/op_mode/ping.py", line 258, in <module>
    result = options[matched[0]]['helpfunction']()
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/vyos/utils/network.py", line 206, in interface_list
    return Section.interfaces()
           ^^^^^^^
NameError: name 'Section' is not defined

Possible completions:
  <Enter>               Execute the current command
  <text>                Ping options

After:

vyos@R1:~$ ping 8.8.8.8 interface
Possible completions:
  <Enter>               Execute the current command
  eth0                  Ping options
  eth1
  eth2
  eth3
  lo

How to test

Run this command:

$ ping 8.8.8.8 interface ?

Smoketest result

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

@vyosbot vyosbot requested review from a team, dmbaturin, sarthurdev, zdc, jestabro, sever-sever and c-po and removed request for a team December 8, 2023 18:27
@c-po c-po merged commit 520889c into vyos:current Dec 8, 2023
8 checks passed
@c-po
Copy link
Member

c-po commented Dec 8, 2023

@Mergifyio backport sagitta

Copy link

mergify bot commented Dec 8, 2023

backport sagitta

✅ Backports have been created

sever-sever added a commit that referenced this pull request Dec 8, 2023
op-cmd: T5802: bug fix for "ping x.x.x.x interface" completion options (backport #2594)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 participants