From 6a2ed6c285b74f463f223d3501def8ef4e6283b1 Mon Sep 17 00:00:00 2001 From: Mehdi Abaakouk Date: Fri, 26 Oct 2018 11:59:55 +0200 Subject: [PATCH] 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 --- src/ceph-volume/bin/ceph-volume | 6 ------ src/ceph-volume/bin/ceph-volume-systemd | 6 ------ src/ceph-volume/setup.py | 8 ++++++-- 3 files changed, 6 insertions(+), 14 deletions(-) delete mode 100755 src/ceph-volume/bin/ceph-volume delete mode 100755 src/ceph-volume/bin/ceph-volume-systemd diff --git a/src/ceph-volume/bin/ceph-volume b/src/ceph-volume/bin/ceph-volume deleted file mode 100755 index 5905cfccc01b3..0000000000000 --- 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 7da8ec6b1cc1d..0000000000000 --- 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 cfdb1e1a9f3f3..9bd48178cbf4f 100644 --- a/src/ceph-volume/setup.py +++ b/src/ceph-volume/setup.py @@ -17,7 +17,12 @@ '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 @@ 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', ] - )