Issue #600
closedrepos and users named with a single period
Description
Description of problem:
It's possible to create a repo named '.' (period), but after it's not possible to do anything with this repo, e.g. to update or delete.
Version-Release number of selected component (if applicable):
rpm -qa | grep pulp-server
pulp-server-2.5.0-0.14.beta.el6.noarch
How reproducible:
always
Steps to Reproduce:
pulp-admin docker repo create --repo-id=' '
Validation failed for argument [--repo-id]: value must contain only letters,
numbers, underscores, periods and hyphens
pulp-admin docker repo create --repo-id='.'
Repository [.] successfully created
pulp-admin docker repo create --repo-id='-'
Repository [-] successfully created
pulp-admin -u admin -p admin docker repo list
--------------------------------------------------------------------
Docker Repositories
--------------------------------------------------------------------
Id: zoo
Display Name: zoo
Description: None
Content Unit Counts:
Id: _
Display Name: _
Description: None
Content Unit Counts:
Id: woo.doo
Display Name: woo.doo
Description: None
Content Unit Counts:
Id: .
Display Name: .
Description: None
Content Unit Counts:
Id: -
Display Name: -
Description: None
Content Unit Counts:
Id: 1
Display Name: 1
Description: None
Content Unit Counts:
Id: _
Display Name: _
Description: None
Content Unit Counts:
pulp-admin -u admin -p admin docker repo update --repo-id '_' --description='update underscore repo'
Repository [_] successfully updated
pulp-admin -u admin -p admin docker repo list
--------------------------------------------------------------------
Docker Repositories
--------------------------------------------------------------------
Id: zoo
Display Name: zoo
Description: None
Content Unit Counts:
Id: woo.doo
Display Name: woo.doo
Description: None
Content Unit Counts:
Id: .
Display Name: .
Description: None
Content Unit Counts:
Id: _
Display Name: _
Description: None
Content Unit Counts:
Id: _
Display Name: _
Description: update underscore repo
Content Unit Counts:
pulp-admin -u admin -p admin docker repo update --repo-id . --description='update period repo'
An unexpected error has occurred. More information can be found in the client
log file ~/.pulp/admin.log.
pulp-admin -u admin -p admin docker repo delete --repo-id='.'
The web server reported an error trying to access the Pulp application. The
likely cause is that the pulp-manage-db script has not been run prior to
starting the server. More information can be found in Apache's error log file on
the server itself.
pulp-admin -u admin -p admin docker repo delete --repo-id '.'
The web server reported an error trying to access the Pulp application. The
likely cause is that the pulp-manage-db script has not been run prior to
starting the server. More information can be found in Apache's error log file on
the server itself.
less ~/.pulp/admin.log
2014-10-30 17:00:45,829 - ERROR - Client-side exception occurred
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/pulp/client/extensions/core.py", line 478, in run
exit_code = Cli.run(self, args)
File "/usr/lib/python2.6/site-packages/okaara/cli.py", line 974, in run
exit_code = command_or_section.execute(self.prompt, remaining_args)
File "/usr/lib/python2.6/site-packages/pulp/client/extensions/extensions.py", line 224, in execute
return self.method(*arg_list, **clean_kwargs)
File "/usr/lib/python2.6/site-packages/pulp/client/commands/repo/cudl.py", line 171, in run
delete_task = self.context.server.repo.delete(self.repo_id).response_body
File "/usr/lib/python2.6/site-packages/pulp/bindings/repository.py", line 100, in delete
return self.server.DELETE (path)
File "/usr/lib/python2.6/site-packages/pulp/bindings/server.py", line 90, in DELETE
return self._request('DELETE', path, body=body)
File "/usr/lib/python2.6/site-packages/pulp/bindings/server.py", line 151, in _request
self._handle_exceptions(response_code, response_body)
File "/usr/lib/python2.6/site-packages/pulp/bindings/server.py", line 187, in _handle_exceptions
raise exceptions.ApacheServerException(response_body)
ApacheServerException
2014-10-30 17:01:22,244 - ERROR - Client-side exception occurred
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/pulp/client/extensions/core.py", line 478, in run
exit_code = Cli.run(self, args)
File "/usr/lib/python2.6/site-packages/okaara/cli.py", line 974, in run
exit_code = command_or_section.execute(self.prompt, remaining_args)
File "/usr/lib/python2.6/site-packages/pulp/client/extensions/extensions.py", line 224, in execute
return self.method(*arg_list, **clean_kwargs)
File "/usr/lib/python2.6/site-packages/pulp_docker/extensions/admin/cudl.py", line 183, in run
scratchpad = response.get(u'scratchpad', {})
AttributeError: 'list' object has no attribute 'get'
+ This bug was cloned from Bugzilla Bug #1159071 +
Updated by igulina@redhat.com about 8 years ago
However, everything is fine if a repo-id starts with a period....
pulp-admin docker repo list
--------------------------------------------------------------------
Docker Repositories
--------------------------------------------------------------------
Id: zoo
Display Name: zoo
Description: None
Content Unit Counts:
Id: woo.doo
Display Name: woo.doo
Description: None
Content Unit Counts:
Id: .
Display Name: .
Description: None
Content Unit Counts:
pulp-admin docker repo create --repo-id .myrepo
Repository [.myrepo] successfully created
pulp-admin -u admin -p admin docker repo update --repo-id .myrepo --description 'my repo'
Repository [.myrepo] successfully updated
pulp-admin
u admin -p admin docker repo list+---------------------------------------------------------------------+
Docker Repositories
--------------------------------------------------------------------
Id: zoo
Display Name: zoo
Description: None
Content Unit Counts:
Id: woo.doo
Display Name: woo.doo
Description: None
Content Unit Counts:
Id: .
Display Name: .
Description: None
Content Unit Counts:
Id: .myrepo
Display Name: .myrepo
Description: my repo
Content Unit Counts:
+ This comment was cloned from Bugzilla #1159071 comment 1 +
Updated by amacdona@redhat.com about 8 years ago
I think this is a webpy problem.
/v2/repositories/foo/ and matches based on foo/
/v2/reposotiroes/./ matches /
/v2/repositories/././ also matches /
We can validate against the repo name of '.' but I think this will probably be fixed by a move to Django, so I will leave it for now.
+ This comment was cloned from Bugzilla #1159071 comment 2 +
Updated by igulina@redhat.com about 8 years ago
Here is a little note that the user has the same issue if named with a signle perid [1]. Ok, let's wait for moving to Django.
[1] https://bugzilla.redhat.com/show_bug.cgi?id=1158138#c4
+ This comment was cloned from Bugzilla #1159071 comment 3 +
Updated by amacdona@redhat.com about 8 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to amacdona@redhat.com
Updated by amacdona@redhat.com almost 8 years ago
- Status changed from ASSIGNED to NEW
Unfortunately, we did not get this for free in the Django conversion.
`/./` is ignored in the urls
/repositories/./
still matches
/repositories/
Interestingly the Django request object does not have the `/./` on the url.
Updated by amacdona@redhat.com almost 8 years ago
Notice the `_href` field for the "." repository.
$ curl -s -H "Accept: application/json" -H "WebFrameworkSwitch: webpy" -X GET -k -u admin:admin "https://localhost/pulp/api/v2/repositories/search/" | python -mjson.tool
[
{
"_href": "/pulp/api/v2/repositories/",
"_id": {
"$oid": "551d4c6fe138230c9e8c7612"
},
"_ns": "repos",
"content_unit_counts": {},
"description": null,
"display_name": ".",
"id": ".",
"last_unit_added": null,
"last_unit_removed": null,
"notes": {
"_repo-type": "rpm-repo"
}
}
]
Updated by amacdona@redhat.com almost 8 years ago
- Assignee deleted (
amacdona@redhat.com) - Triaged changed from Yes to No
Updated by bmbouter almost 4 years ago
- Status changed from NEW to CLOSED - WONTFIX
Updated by bmbouter almost 4 years ago
Pulp 2 is approaching maintenance mode, and this Pulp 2 ticket is not being actively worked on. As such, it is being closed as WONTFIX. Pulp 2 is still accepting contributions though, so if you want to contribute a fix for this ticket, please reopen or comment on it. If you don't have permissions to reopen this ticket, or you want to discuss an issue, please reach out via the developer mailing list.