]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
cephadm: move abstract script handling functions to runscripts.py
authorJohn Mulligan <jmulligan@redhat.com>
Wed, 15 Nov 2023 21:39:07 +0000 (16:39 -0500)
committerJohn Mulligan <jmulligan@redhat.com>
Sun, 10 Dec 2023 15:26:04 +0000 (10:26 -0500)
commit49245dabeb2b9caf7d8df79a27f3647aa2c86674
tree43a24d259bf938609bb18e2caec4d1a691114db1
parenteaa6cbd39fb0e8c1259c0aa7e8a73cc8d65f3a29
cephadm: move abstract script handling functions to runscripts.py

Add a new file runscripts.py for the lower-level management of scripts
and related files that are invoked by systemd units. This patch ended up
uglier than I desired because there was a bunch of daemon specific logic
that remains in cephadm.py and those functions all needed to be updated
to avoid calling functions that write to the scripts directly.
Now customizations are done by passing a list of commands: these
commands can be either a string that will be literally added to the
scipt, a list that will be quoted and then added to the script, or
a ContainerCommand which is basically a wrapper around the arguments to
_write_container_cmd_to bash.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/cephadm/cephadm.py
src/cephadm/cephadmlib/runscripts.py [new file with mode: 0644]