cephadm: extract python() helper to execute python statement
to prepare for a change to use importlib, then fallback to
pkg_resources. as the former is only available in Python 3.8, while
the latter is deprecated.
Refs https://tracker.ceph.com/issues/66201
Signed-off-by: Kefu Chai <tchaikov@gmail.com>
(cherry picked from commit
be1a8c2c43e97f91bd26554ba9dadc71c499865d)
Conflicts:
src/cephadm/cephadmlib/daemons/iscsi.py [ this file doesn't
exist in quincy, get_version() lives in src/cephadm/cephadm ]