]> git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/cephadm/remotes.py
import 15.2.0 Octopus source
[ceph.git] / ceph / src / pybind / mgr / cephadm / remotes.py
1 # ceph-deploy ftw
2 import os
3 import errno
4 import tempfile
5 import shutil
6
7 PYTHONS = ['python3', 'python2', 'python']
8 PATH = [
9 '/usr/bin',
10 '/usr/local/bin',
11 '/bin',
12 '/usr/sbin',
13 '/usr/local/sbin',
14 '/sbin',
15 ]
16
17 def choose_python():
18 for e in PYTHONS:
19 for b in PATH:
20 p = os.path.join(b, e)
21 if os.path.exists(p):
22 return p
23 return None
24
25 if __name__ == '__channelexec__':
26 for item in channel: # type: ignore
27 channel.send(eval(item)) # type: ignore