pulp-manage-db requires pulp services to be shut down even in dry run mode
In our automation scripts, we run pulp-manage-db in dry-run mode in order to check whether we need to apply migrations (pulp-manage-db returns a specific error code in that case). This may happen in two situations:
1. We actually did a Pulp upgrade (in that case Pulp services are not activated when the check is run)
2. Something went very wrong and there are migrations to be applied although Pulp is running
With Pulp 2.13 (and maybe earlier, we ran 2.10 before), we cannot use pulp-manage-db for the second case anymore since it refuses to run in dry run mode when Pulp services are running. Of course, we don't want to stop/start services just to check for a case that is not supposed to happen. (Nevertheless, we think this check delivers an important signal if it triggers)
How to reproduce:
sudo -u apache pulp-manage-db --dry-run on a running Pulp server. pulp-manage-db will wait for 90 seconds and exit with an error, i.e. not doing any checks.
The expected behavior is to actually do the DB checks in dry run mode instead.
#2 Updated by bmbouter over 4 years ago
- Tags Easy Fix added
gmbnomis, thank you for filing this. It should be an easy fix. The quickest way to get it resolved is if you can submit a PR for it. I think you just need to guard this code with an if statement that checks to see if dry-run is True.
Pulp has a Vagrant developer environment  which should make it easier to have an environment to test with. If there is any way we can help you with your contribution please let us know.
#4 Updated by bmbouter over 4 years ago
gmbnomis Great. Yes, please target 2.13-dev. You may find these docs helpful: http://docs.pulpproject.org/dev-guide/contributing/branching.html#bug-fix-branches
Also, I'm 'bmbouter' in #pulp-dev if you want to ask any questions there.