]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
script: add a new cpatch.py that is like cpatch but in python 47573/head
authorJohn Mulligan <jmulligan@redhat.com>
Mon, 25 Jul 2022 21:01:12 +0000 (17:01 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Tue, 1 Aug 2023 11:58:25 +0000 (07:58 -0400)
commit524385b671924131e04fd8b074b0942ad0a31564
tree2300fff5495851c4ba8931f4d59e681827112d56
parent68dda2195316a05f13bb91a5b76c14780f4ed0e6
script: add a new cpatch.py that is like cpatch but in python

This is a somewhat straightforward translation of the current cpatch
bash script into python. The image is built in the same manner but some
of the python components can be selected in a more granular manner.

Why do this? I had my own private copy of the cpatch script that I have
been modifying for my own needs, one that has the previously mentioned
more granular selection of python components. However, I had additional
plans for this script and found it difficult to manage and I felt that a
single-source-file python program would allow the use of python's nicer
(IMO) CLI parsing, data structures, and standard library modules. I also
think that this provides a cleaner program structure that will allow for
experimentation with different backends vs. the current approach of
copying files and creating a temporary Dockerfile.

For whatever reason the original cpatch was assuming that the python
version was 3.8, however in the current ceph images using centos 8
stream as a base, python 3.6 is the available python version.

Old versions of ceph kept cephadm as one large single source file in the
source tree. New versions "compile" cephadm into a python zipapp. Try to
automatically detect which case and "install" the correct form of
cephadm.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/script/cpatch.py [new file with mode: 0755]