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

AttributeError: 'NoneType' object has no attribute 'get' #711

Closed
drzero42 opened this issue Mar 4, 2015 · 2 comments
Closed

AttributeError: 'NoneType' object has no attribute 'get' #711

drzero42 opened this issue Mar 4, 2015 · 2 comments

Comments

@drzero42
Copy link

drzero42 commented Mar 4, 2015

When I try to tab-complete 'nipap address add node' I get this Traceback:

Traceback (most recent call last):
File "/usr/bin/helper-nipap", line 50, in
comp = sorted(cmd.complete())
File "/usr/lib/python2.7/dist-packages/nipap_cli/command.py", line 264, in complete
comp += v'complete'
File "/usr/lib/python2.7/dist-packages/nipap_cli/nipap_cli.py", line 1747, in complete_node
cmd = cfg.get('global', 'complete_node_cmd')
AttributeError: 'NoneType' object has no attribute 'get'

I am on Ubuntu 14.04.
$ nipap --version
nipap CLI client version: 0.27.4
pynipap version: 0.27.3
nipapd version: 0.27.3

@plajjan plajjan added this to the Triage milestone Mar 29, 2015
@plajjan
Copy link
Member

plajjan commented May 2, 2015

The traceback is generated by nipap-helper, which is the application that does tab completion for the nipap cli. It tries to read parameters from its configuration file but fails to do so as the configuration file is not available. It tries to access ~/.nipaprc so my guess is that you haven't defined a .nipaprc file.

Obviously we should handle this in a more graceful way. I'm not quite sure how though.

  • Suppress error?
  • Print error message? I think it's weird for a tab completion program to print an error message..

@plajjan
Copy link
Member

plajjan commented Jul 23, 2015

I don't think writing an error message makes much sense. I've fiddled around with it a bit and I can't come up with a good way to print an error message.

Therefore, suppressing the error message is the only solution I see.

plajjan added a commit to plajjan/NIPAP that referenced this issue Jul 23, 2015
There are cases, such as when .nipaprc doesn't exist, that prevents
helper-nipap to work completely. Suppressing any such error message
seems to be the only reasonable option and therefore I've modified this
try/except clause to match all exceptions.

Fixes SpriteLink#711.
@plajjan plajjan modified the milestones: Version 0.29 - Zeus, Triage Jul 23, 2015
garberg pushed a commit to garberg/NIPAP that referenced this issue Jul 26, 2015
There are cases, such as when .nipaprc doesn't exist, that prevents
helper-nipap to work completely. Suppressing any such error message
seems to be the only reasonable option and therefore I've modified this
try/except clause to match all exceptions.

Fixes SpriteLink#711.
@plajjan plajjan self-assigned this Sep 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants