]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
script: subscription-manager support (part 2) 8293/head
authorLoic Dachary <ldachary@redhat.com>
Thu, 24 Mar 2016 10:59:33 +0000 (11:59 +0100)
committerLoic Dachary <ldachary@redhat.com>
Sat, 26 Mar 2016 18:20:57 +0000 (19:20 +0100)
Strip the .py suffix so that no pyc / pyo files are generated.
Do not install on CentOS.

http://tracker.ceph.com/issues/14972 Fixes: #14972

Signed-off-by: Loic Dachary <loic@dachary.org>
ceph.spec.in
configure.ac
src/Makefile.am
src/script/subman [new file with mode: 0755]
src/script/subman.py [deleted file]

index ac2b32b7b968a2b32411ada60adfbf617d985a15..1fdeff6951be48f452d1df79669004e86ef7b39a 100644 (file)
@@ -685,7 +685,7 @@ export RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed -e 's/i386/i486/'`
                 --libexecdir=%{_libexecdir} \
                --localstatedir=/var \
                --sysconfdir=/etc \
-%if 0%{?rhel}
+%if 0%{?rhel} && ! 0%{?centos}
                 --enable-subman \
 %endif
 %if 0%{?_with_systemd}
@@ -1189,8 +1189,8 @@ fi
 %{_mandir}/man8/ceph-clsinfo.8*
 %{_mandir}/man8/ceph-disk.8*
 %{_mandir}/man8/ceph-osd.8*
-%if 0%{?rhel}
-/etc/cron.hourly/subman.py
+%if 0%{?rhel} && ! 0%{?centos}
+/etc/cron.hourly/subman
 %endif
 %if 0%{?_with_systemd}
 %{_unitdir}/ceph-osd@.service
index 20d50f3f50ead30b903d31292b89a77487f9e04f..48a7fc2bf60b4601869cfdd11069cc865fb69f1b 100644 (file)
@@ -211,8 +211,8 @@ AM_CONDITIONAL(ENABLE_SERVER, test "$enable_server" = "yes")
 AC_ARG_ENABLE([subman],
        [AS_HELP_STRING([--enable-subman], [enable subman])],
        [],
-       [enable_subman=yes])
-AM_CONDITIONAL([ENABLE_SUBMAN], test "$enable_subman" = "yes")
+       [enable_subman=no])
+AM_CONDITIONAL([ENABLE_SUBMAN], test "x$enable_subman" != "xno")
 
 # cython is required to build python bindings for libraries
 if test x"$with_cython" = xyes; then
index 528a74994a6e366798557152450c8ede9e991c20..1d8f8bbe36e8dd932398eb718c729c370e65c7b1 100644 (file)
@@ -107,7 +107,7 @@ EXTRA_DIST += \
        $(srcdir)/.git_version \
        $(srcdir)/ceph-rbdnamer \
        $(srcdir)/tools/ceph-monstore-update-crush.sh \
-       $(srcdir)/script/subman.py \
+       $(srcdir)/script/subman \
        $(srcdir)/upstart/ceph-all.conf \
        $(srcdir)/upstart/ceph-disk.conf \
        $(srcdir)/upstart/ceph-mon.conf \
@@ -155,7 +155,7 @@ ceph_libexec_SCRIPTS = ceph_common.sh ceph-osd-prestart.sh
 
 if ENABLE_SUBMAN
 submandir = /etc/cron.hourly
-subman_SCRIPTS = script/subman.py
+subman_SCRIPTS = script/subman
 endif
 
 # tests to actually run on "make check"; if you need extra, non-test,
diff --git a/src/script/subman b/src/script/subman
new file mode 100755 (executable)
index 0000000..9bd69c5
--- /dev/null
@@ -0,0 +1,20 @@
+#!/usr/bin/env python
+
+import json
+import re
+import subprocess
+
+disks = json.loads(subprocess.check_output("ceph-disk list --format json", shell=True))
+used = 0
+
+for disk in disks:
+    for partition in disk.get('partition', []):
+        if partition.get('type') == 'data':
+            df = subprocess.check_output("df --output=used " + partition['path'], shell=True)
+            used += int(re.findall('\d+', df)[0])
+
+open("/etc/rhsm/facts/ceph_usage.facts", 'w').write("""
+{
+"band.storage.usage": {used}
+}
+""".format(used=used/(1024*1024*1024)))
diff --git a/src/script/subman.py b/src/script/subman.py
deleted file mode 100755 (executable)
index 9bd69c5..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/env python
-
-import json
-import re
-import subprocess
-
-disks = json.loads(subprocess.check_output("ceph-disk list --format json", shell=True))
-used = 0
-
-for disk in disks:
-    for partition in disk.get('partition', []):
-        if partition.get('type') == 'data':
-            df = subprocess.check_output("df --output=used " + partition['path'], shell=True)
-            used += int(re.findall('\d+', df)[0])
-
-open("/etc/rhsm/facts/ceph_usage.facts", 'w').write("""
-{
-"band.storage.usage": {used}
-}
-""".format(used=used/(1024*1024*1024)))