Bug 669520 - Need a cleaner error message in package search when specifying an invalid regex
Summary: Need a cleaner error message in package search when specifying an invalid regex
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: z_other
Version: unspecified
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: ---
: Sprint 25
Assignee: James Slagle
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On:
Blocks: verified-to-close 673021
TreeView+ depends on / blocked
 
Reported: 2011-01-13 21:11 UTC by Jay Dobies
Modified: 2011-08-16 12:22 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-08-16 12:09:53 UTC
Embargoed:


Attachments (Terms of Use)

Description Jay Dobies 2011-01-13 21:11:07 UTC
$ pulp-admin package search --version '*foo'
error: operation failed: Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/controllers/base.py", line 57, in report_error
    return method(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/role_check.py", line 131, in check_roles
    result = f(instance, *fargs, **kw)
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/controllers/services.py", line 100, in PUT
    release=release, arch=arch, filename=filename, regex=True)
  File "/usr/lib/python2.7/site-packages/pulp/server/api/package.py", line 103, in packages
    searchDict['version'] = {"$regex":re.compile(version)}
  File "/usr/lib64/python2.7/re.py", line 190, in compile
    return _compile(pattern, flags)
  File "/usr/lib64/python2.7/re.py", line 245, in _compile
    raise error, v # invalid expression
error: nothing to repeat

Comment 1 Sayli Karmarkar 2011-03-14 22:59:11 UTC
Part of this is fixed by because of jconnor and jmatthews's fixes for server side
traceback. However, it error message should state that regex is invalid instead of following message:

$ sudo pulp-admin package search --version '*foo'
error: operation failed: error: nothing to repeat

Comment 2 James Slagle 2011-06-15 20:29:29 UTC
I committed a fix for this in commit 0122bb4fb545dba3b065734b6b6c997a23535e09.  There should now be a more friendly error like:
error: operation failed: RegularExpressionError: "The regular expression '*3.11' is not valid: nothing to repeat"

Comment 3 Jeff Ortel 2011-06-17 21:10:09 UTC
build: 0.192

Comment 4 Preethi Thomas 2011-07-06 17:03:31 UTC
[root@preethi ~]# rpm -q pulp
pulp-0.0.200-1.fc14.noarch

[root@preethi ~]# pulp-admin package search --version '*foo'
error: operation failed: RegularExpressionError: "The regular expression '*foo' is not valid: nothing to repeat"

Comment 5 Preethi Thomas 2011-08-16 12:09:53 UTC
Closing with Community Release 15

pulp-0.0.223-4.

Comment 6 Preethi Thomas 2011-08-16 12:22:10 UTC
Closing with Community Release 15

pulp-0.0.223-4.


Note You need to log in before you can comment on or make changes to this bug.