[obs-commits] [openSUSE/osc] cb6eaf: Fix single service disabled run

Branch: refs/heads/master Home: https://github.com/openSUSE/osc Commit: cb6eaf3720fdd5206c2bc06d7bf444c6fdd14ecb https://github.com/openSUSE/osc/commit/cb6eaf3720fdd5206c2bc06d7bf444c6fdd14... Author: Colleen Murphy <colleen.murphy@suse.com> Date: 2020-08-03 (Mon, 03 Aug 2020) Changed paths: M osc/commandline.py M osc/core.py Log Message: ----------- Fix single service disabled run Without this patch, running an individual service that has parameters defined in the _service file fails: $ osc service run obs_scm Please specify valid --scm=... options Aborting: service call failed: /usr/lib/obs/service/obs_scm --outdir [snipped] This is because although the service is defined in the _service file and the "scm" parameter is set in it, the service wasn't being found in the data structure and so the service executable wasn't being called with the parameters supplied in the _service file. This patch corrects the issue with the services data structure so that the service data isn't overridden if it is defined in the _service file. A side effect of this correction for services defined in the _service file is that instead of overriding the service mode with '', the mode is taken from the _service file. When using the "run" command, this would mean that the call mode of None may not be in agreement with the service mode defined in the file, e.g. "manual", and so the "run" command would no longer cause it to run when it would before. We can take this opportunity to define this as the correct behavior - the "run" command now only runs services with "trylocal", "localonly", or no mode set - and also ensure that other call mode commands result in sensible behavior when called with a service name, for instance "osc service manualrun download_files" will run only services with mode="manual" and name="download"files" instead of all services with mode="manual". Additionally, services that aren't defined in the _service file can be called with a call mode command and will use that call mode rather than None. Commit: 3216a56d087cfe07355d613cc663e90f879c58d9 https://github.com/openSUSE/osc/commit/3216a56d087cfe07355d613cc663e90f879c5... Author: Marcus Huewe <suse-tux@gmx.de> Date: 2020-08-04 (Tue, 04 Aug 2020) Changed paths: M osc/commandline.py M osc/core.py Log Message: ----------- Merge branch 'fix-single-service-run' of https://github.com/cmurphy/osc Fix "osc service run <service>" so that it takes the parameters from the _service file if <service> is present in the _service file. Also document (+ fix) the (undocumented) "osc service <command> <service>" behavior. This enables, for instance, to run "osc service mr foobar", which would execute all foobar services with mode "manual" (now, this also works, if the foobar service is not part of the _service file). Compare: https://github.com/openSUSE/osc/compare/7612fe161414...3216a56d087c
participants (1)
-
Marcus Hüwe