Issue #1016
closeddocker sync fails in an unexpected way if feed url scheme is not specified
Description
If you don't specify http or https in the feed url, you will get a confusing error.
For example:
- pulp-admin docker repo create --repo-id=synctest3 --feed=index.docker.io --upstream-name=busybox
Repository [synctest3] successfully created
However, when you attempt to sync:
pulp-admin docker repo sync run --repo-id synctest3
you will get:
Invalid URL u'/v1/repositories/busybox/images': No schema supplied. Perhaps you meant http:///v1/repositories/busybox/images?
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/nectar/downloaders/threaded.py", line 190, in _fetch
response = session.get(request.url, headers=headers)
File "/usr/lib/python2.6/site-packages/requests/sessions.py", line 469, in get
return self.request('GET', url, **kwargs)
File "/usr/lib/python2.6/site-packages/requests/sessions.py", line 443, in request
prep = self.prepare_request(req)
File "/usr/lib/python2.6/site-packages/requests/sessions.py", line 374, in prepare_request
hooks=merge_hooks(request.hooks, self.hooks),
File "/usr/lib/python2.6/site-packages/requests/models.py", line 304, in prepare
self.prepare_url(url, params)
File "/usr/lib/python2.6/site-packages/requests/models.py", line 358, in prepare_url
"Perhaps you meant http://{0}?".format(url))
MissingSchema: Invalid URL u'/v1/repositories/busybox/images': No schema supplied. Perhaps you meant http:///v1/repositories/busybox/images?
Ideally, pulp-admin would notice that the URL scheme is missing and raise an error during repo creation.