From: Mehdi Abaakouk Date: Fri, 26 Oct 2018 09:59:55 +0000 (+0200) Subject: ceph-volume: use console_scripts X-Git-Tag: v14.1.0~1049^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F24773%2Fhead;p=ceph.git ceph-volume: use console_scripts Using "#!/usr/bin/env python" is not recommended as it's not portable. setuptools provides an console_scripts entry_point that generates scripts that always have the good sheban whatever the target operating system and python version/distribution. http://tracker.ceph.com/issues/36601 Signed-off-by: Mehdi Abaakouk --- diff --git a/src/ceph-volume/bin/ceph-volume b/src/ceph-volume/bin/ceph-volume deleted file mode 100755 index 5905cfccc01b..000000000000 --- a/src/ceph-volume/bin/ceph-volume +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env python - -from ceph_volume import main - -if __name__ == '__main__': - main.Volume() diff --git a/src/ceph-volume/bin/ceph-volume-systemd b/src/ceph-volume/bin/ceph-volume-systemd deleted file mode 100755 index 7da8ec6b1cc1..000000000000 --- a/src/ceph-volume/bin/ceph-volume-systemd +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env python - -from ceph_volume.systemd import main - -if __name__ == '__main__': - main.main() diff --git a/src/ceph-volume/setup.py b/src/ceph-volume/setup.py index cfdb1e1a9f3f..9bd48178cbf4 100644 --- a/src/ceph-volume/setup.py +++ b/src/ceph-volume/setup.py @@ -17,7 +17,12 @@ setup( 'pytest >=2.1.3', 'tox', ], - scripts = ['bin/ceph-volume', 'bin/ceph-volume-systemd'], + entry_points = dict( + console_scripts = [ + 'ceph-volume = ceph_volume.main:Volume', + 'ceph-volume-systemd = ceph_volume.systemd:main', + ], + ), classifiers = [ 'Environment :: Console', 'Intended Audience :: Information Technology', @@ -29,5 +34,4 @@ setup( 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', ] - )