-
Notifications
You must be signed in to change notification settings - Fork 659
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
Conversation
This pull request introduces 4 alerts when merging 1f4e1a84c842e715ce72b16534325e9422b842fe into 8768580 - view on LGTM.com new alerts:
|
This pull request introduces 6 alerts when merging 5071da84c178eda8f6133869c363d8cc7445dc2f into 8768580 - view on LGTM.com new alerts:
|
show/main.py
Outdated
elif ":" in tk: | ||
key_avail['ipv6'] = tk | ||
|
||
if nhg == "fgnhg_v4": |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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": |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed
This pull request introduces 6 alerts when merging b2954398a5ca8e7ba10aec7a59e0ed36ff35b6bc into 8768580 - view on LGTM.com new alerts:
|
please add unit test and also check the coverage report generated. |
There was a problem hiding this 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.
please address lgtm warnings |
show/main.py
Outdated
@@ -1917,6 +1917,210 @@ def mmu(): | |||
click.echo(proc.stdout.read()) | |||
|
|||
|
|||
# |
There was a problem hiding this comment.
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') |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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!") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use ctx.fail()
This pull request introduces 3 alerts when merging cd656d227890d7fe278394754cf59fbcc14bac40 into 96cb359 - view on LGTM.com new alerts:
|
This pull request introduces 3 alerts when merging df9d02c107df521efce184d0d9aa594d6a28f117 into 96cb359 - view on LGTM.com new alerts:
|
retest default please |
retest this please |
3 similar comments
retest this please |
retest this please |
retest this please |
show/ecmp.py
Outdated
from collections import OrderedDict | ||
|
||
@click.group(cls=clicommon.AliasedGroup) | ||
def ecmp(): |
There was a problem hiding this comment.
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?
can you paste the coverage report results? |
tests/fgnhg_test.py
Outdated
|
||
|
||
|
||
class TestECMP(object): |
There was a problem hiding this comment.
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
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
retest this please |
show fg-nhg-hash-view
(shows the current hash bucket view of fg nhg)
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)