Removing a Docker repository can cause a TypeError if the repo has not been published
Steps to reproduce:
0) $ pulp-admin docker repo create --repo-id busybox
1) $ pulp-admin docker repo delete --repo-id busybox
$ pulp-admin docker repo delete --repo-id busybox This command may be exited via ctrl+c without affecting the request. [\] Running... Task Failed Pulp exception occurred: PulpExecutionException coercing to Unicode: need string or buffer, NoneType found coercing to Unicode: need string or buffer, NoneType found
In the log, this exception appears:
Error received removing distributor [docker_web_distributor_name_cli] from repo [busybox] Traceback (most recent call last): File "/home/vagrant/devel/pulp/server/pulp/server/controllers/repository.py", line 311, in delete distributor_manager.remove_distributor(repo_id, repo_distributor['id']) File "/home/vagrant/devel/pulp/server/pulp/server/managers/repo/distributor.py", line 228, in remove_distributor distributor_instance.distributor_removed(transfer_repo, call_config) File "/home/vagrant/devel/pulp_docker/plugins/pulp_docker/plugins/distributors/distributor_web.py", line 162, in distributor_removed shutil.rmtree(repo_dir, ignore_errors=True) File "/usr/lib64/python2.7/shutil.py", line 228, in rmtree if os.path.islink(path): File "/usr/lib64/python2.7/posixpath.py", line 135, in islink st = os.lstat(path) TypeError: coercing to Unicode: need string or buffer, NoneType found
The repo should be deleted without error.
Similar errors have been reported against other plugins, and are linked in related issues.