links with underscores in their names raise InvalidKeyword

Open
#3 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
python
Domain
backend

Research direction

Start in go.py at getList and the InvalidKeyword raise around line 591, then trace how list names are validated and how the default handler calls this path. Determine the intended underscore policy and define done as either supporting these names or returning an error that clearly explains the restriction, with coverage for the reported keyword.

Written by the indexing model from the issue text.

Description

We need to return a better error here for the user. They're not told why an underscore is wrong, nor do I really know why it's wrong. Should we allow them?

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/cherrypy/_cprequest.py", line 670, in respond
    response.body = self.handler()
  File "/usr/local/lib/python2.7/site-packages/cherrypy/lib/encoding.py", line 217, in __call__
    self.body = self.oldhandler(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/cherrypy/_cpdispatch.py", line 61, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "./go.py", line 757, in default
    ll = g_db.getList(keyword, create=False)
  File "/home/lab/tools/general/f5go/go.py", line 591, in getList
    raise InvalidKeyword("keyword '%s' not sanitary" % listname)
InvalidKeyword: keyword 'with_underscores' not sanitary
Dominant language
Python
Stars
22
Forks
10
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from f5devcentral/f5go

All issues in f5devcentral/f5go

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.