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

Show FG_NHG CLI Commands Added #1056

Merged
merged 10 commits into from
Oct 29, 2020
Merged

Show FG_NHG CLI Commands Added #1056

merged 10 commits into from
Oct 29, 2020

Conversation

kktheballer
Copy link
Contributor

  1. show fg-nhg-hash-view
    (shows the current hash bucket view of fg nhg)

  2. show fg-nhg-active-hops
    (shows which set of next-hops are active)

- What I did

- How I did it

- How to verify it

- Previous command output (if the output of a command-line utility has changed)

- New command output (if the output of a command-line utility has changed)

@lgtm-com
Copy link

lgtm-com bot commented Aug 18, 2020

This pull request introduces 4 alerts when merging 1f4e1a84c842e715ce72b16534325e9422b842fe into 8768580 - view on LGTM.com

new alerts:

  • 4 for Except block handles 'BaseException'

@lgtm-com
Copy link

lgtm-com bot commented Aug 18, 2020

This pull request introduces 6 alerts when merging 5071da84c178eda8f6133869c363d8cc7445dc2f into 8768580 - view on LGTM.com

new alerts:

  • 6 for Except block handles 'BaseException'

show/main.py Outdated
elif ":" in tk:
key_avail['ipv6'] = tk

if nhg == "fgnhg_v4":
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cannot hardcode name checks here, the user may configure any name they desire

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed

show/main.py Outdated
click.echo("IPV4 nhg does not exist!")
exit()

if nhg == "fgnhg_v6":
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cannot hardcode name checks here, the user may configure any name they desire. Same comment throughout the PR as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed

@lgtm-com
Copy link

lgtm-com bot commented Aug 18, 2020

This pull request introduces 6 alerts when merging b2954398a5ca8e7ba10aec7a59e0ed36ff35b6bc into 8768580 - view on LGTM.com

new alerts:

  • 6 for Except block handles 'BaseException'

@lguohan
Copy link
Contributor

lguohan commented Aug 18, 2020

please add unit test and also check the coverage report generated.

Copy link
Contributor

@lguohan lguohan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add unit test and also check the coverage report generated.

@lguohan
Copy link
Contributor

lguohan commented Aug 19, 2020

please address lgtm warnings

show/main.py Outdated
@@ -1917,6 +1917,210 @@ def mmu():
click.echo(proc.stdout.read())


#
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since this is a new group, please separate into a different file. check show/vlan.py for example.

show/main.py Outdated
@cli.command('fg-nhg-active-hops')
@click.argument('nhg', required=True)
def fg_nhg_active_hops(nhg):
state_db = SonicV2Connector(host='127.0.0.1')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use pass_db decorator.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason, when locally testing using pass_db decorator I wasn't able to fetch my config_db table using "db.cfgdb.get_table()".

Only when using SonicV2Connector was I able to fetch my config_db table. Any suggestions?

show/main.py Outdated
try:
state_db.connect(state_db.STATE_DB, False) # Make one attempt only STATE_DB
except:
click.echo("STATE_DB Table does not exist!")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use ctx.fail()

@lgtm-com
Copy link

lgtm-com bot commented Sep 8, 2020

This pull request introduces 3 alerts when merging cd656d227890d7fe278394754cf59fbcc14bac40 into 96cb359 - view on LGTM.com

new alerts:

  • 2 for Unused local variable
  • 1 for Unused import

@lgtm-com
Copy link

lgtm-com bot commented Sep 8, 2020

This pull request introduces 3 alerts when merging df9d02c107df521efce184d0d9aa594d6a28f117 into 96cb359 - view on LGTM.com

new alerts:

  • 2 for Unused local variable
  • 1 for Unused import

@kktheballer
Copy link
Contributor Author

retest default please

@kktheballer
Copy link
Contributor Author

retest this please

3 similar comments
@kktheballer
Copy link
Contributor Author

retest this please

@kktheballer
Copy link
Contributor Author

retest this please

@kktheballer
Copy link
Contributor Author

retest this please

show/ecmp.py Outdated
from collections import OrderedDict

@click.group(cls=clicommon.AliasedGroup)
def ecmp():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i feel the name should be fgnhg, whic is it ecmp?

@lguohan
Copy link
Contributor

lguohan commented Oct 21, 2020

can you paste the coverage report results?

@kktheballer
Copy link
Contributor Author

image




class TestECMP(object):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just minor comments, better to be rename to TestFineGrainedNexthopGroup

lguohan
lguohan previously approved these changes Oct 27, 2020
1. show fg-nhg-hash-view
   (shows the current hash bucket view of fg nhg)

2. show fg-nhg-active-hops
   (shows which set of next-hops are active)
--> It is identical to show-nhg-hash-view
w/ the addition of hashbucketsize as well as
the nhg prefix
@lguohan lguohan merged commit 8af9aee into sonic-net:master Oct 29, 2020
@kktheballer
Copy link
Contributor Author

retest this please

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 this pull request may close these issues.

3 participants