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

NameError: name 'cli' is not defined when we use config command with SONiC.HEAD.762-1103552 version build #282

Closed
chaitanc opened this issue Nov 5, 2018 · 3 comments

Comments

@chaitanc
Copy link

chaitanc commented Nov 5, 2018

Summary:

NameError: name 'cli' is not defined when we use config command with SONiC.HEAD.762-1103552 version build

Description:

I tried to configure mirror session using below set of command with latest build SONiC.HEAD.762-1103552.

root@sonic-testing:/home/admin# config mirror-session add 10.130.15.2 10.256.8.9 32 64

But observer below error

root@sonic-testing:/home/admin# config mirror-session add 10.130.15.2 10.256.8.9 32 64
Traceback (most recent call last):
  File "/usr/bin/config", line 9, in <module>
    load_entry_point('sonic-utilities==1.2', 'console_scripts', 'config')()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 561, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2631, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2291, in load
    return self.resolve()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2297, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python2.7/dist-packages/config/main.py", line 945, in <module>
    @cli.group()
NameError: name 'cli' is not defined

Issue is not with mirroring configuration, it is with config command. I tried to fetch the help after "config" keyword in cli by pressing tab. Observed the same issue.

root@sonic-testing:/home/admin# config Traceback (most recent call last):
  File "/usr/bin/config", line 9, in <module>
    load_entry_point('sonic-utilities==1.2', 'console_scripts', 'config')()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 561, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2631, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2291, in load
    return self.resolve()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2297, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python2.7/dist-packages/config/main.py", line 945, in <module>
    @cli.group()
NameError: name 'cli' is not defined
.

Traceback (most recent call last):
  File "/usr/bin/config", line 9, in <module>
    load_entry_point('sonic-utilities==1.2', 'console_scripts', 'config')()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 561, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2631, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2291, in load
    return self.resolve()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2297, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python2.7/dist-packages/config/main.py", line 945, in <module>
    @cli.group()
NameError: name 'cli' is not defined

Verified the same with one of the old builds (SONiC-OS-HEAD.757-2897686), it is working fine with no issues.

Working scenario in old builds (SONiC-OS-HEAD.757-2897686) :

0.10.30.5 32 64ing:/home/admin# config mirror_session add everflow1 10.10.20.5 1
root@sonic-testing:/home/admin#
root@sonic-testing:/home/admin#
root@sonic-testing:/home/admin# show mirror session everflow1
Name Status SRC IP DST IP GRE DSCP TTL Queue


everflow1 error 10.10.20.5 10.10.30.5 32 64
root@sonic-testing:/home/admin#
root@sonic-testing:/home/admin#
root@sonic-testing:/home/admin#
root@sonic-testing:/home/admin# show version
SONiC Software Version: SONiC.HEAD.757-2897686
Distribution: Debian 9.5
Kernel: 4.9.0-7-amd64
Build commit: 2897686
Build date: Tue Oct 30 11:22:34 UTC 2018
Built by: johnar@jenkins-worker-3

Expected Result:

config command should be successful when we try to execute. No errors should be shown.

Version:

root@sonic-testing:/home/admin# show version
SONiC Software Version: SONiC.HEAD.762-1103552
Distribution: Debian 9.5
Kernel: 4.9.0-7-amd64
Build commit: 1103552
Build date: Sun Nov 4 09:26:56 UTC 2018
Built by: johnar@jenkins-worker-3

@stcheng
Copy link
Contributor

stcheng commented Nov 5, 2018

this has been fixed: sonic-net/sonic-buildimage#2225

@stcheng stcheng closed this as completed Nov 5, 2018
@chaitanc
Copy link
Author

chaitanc commented Nov 6, 2018

When this will be merged, because I loaded the latest build, observing the same issue. For the time being, I have fixed it in my local.

@stcheng
Copy link
Contributor

stcheng commented Nov 6, 2018

please check the master, I believe it is already merged

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

No branches or pull requests

2 participants