]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: use console_scripts 24837/head
authorMehdi Abaakouk <sileht@sileht.net>
Fri, 26 Oct 2018 09:59:55 +0000 (11:59 +0200)
committerAlfredo Deza <adeza@redhat.com>
Tue, 30 Oct 2018 18:36:42 +0000 (14:36 -0400)
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 <sileht@sileht.net>
(cherry picked from commit 6a2ed6c285b74f463f223d3501def8ef4e6283b1)

src/ceph-volume/bin/ceph-volume [deleted file]
src/ceph-volume/bin/ceph-volume-systemd [deleted file]
src/ceph-volume/setup.py

diff --git a/src/ceph-volume/bin/ceph-volume b/src/ceph-volume/bin/ceph-volume
deleted file mode 100755 (executable)
index 5905cfc..0000000
+++ /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 (executable)
index 7da8ec6..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/usr/bin/env python
-
-from ceph_volume.systemd import main
-
-if __name__ == '__main__':
-    main.main()
index cfdb1e1a9f3f3de7911c3217c0a443262ab00aa0..9bd48178cbf4fd51a43bcb8b3c4f9bb87189d937 100644 (file)
@@ -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',
     ]
-
 )