summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/cephadm/remotes.py
blob: 1c480c105e30d58868fad0ae40a8135fa52af30e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# ceph-deploy ftw
import os
import errno
import tempfile
import shutil

PYTHONS = ['python3', 'python2', 'python']
PATH = [
    '/usr/bin',
    '/usr/local/bin',
    '/bin',
    '/usr/sbin',
    '/usr/local/sbin',
    '/sbin',
]

def choose_python():
    for e in PYTHONS:
        for b in PATH:
            p = os.path.join(b, e)
            if os.path.exists(p):
                return p
    return None

if __name__ == '__channelexec__':
    for item in channel:  # type: ignore
        channel.send(eval(item))  # type: ignore