Skip to content

Commit

Permalink
ceph-detect-init: integration with automake / make check
Browse files Browse the repository at this point in the history
* Add the files to the distribution tarbal via EXTRA_DIST
* Build the module via the all-local target
* Add run-tox.sh to the tests run via make check
* Add manual page

Signed-off-by: Loic Dachary <[email protected]>
  • Loading branch information
ldachary committed May 5, 2015
1 parent 8ee5a82 commit 35a16ff
Show file tree
Hide file tree
Showing 5 changed files with 129 additions and 1 deletion.
54 changes: 54 additions & 0 deletions doc/man/8/ceph-detect-init.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
:orphan:

============================================================
ceph-detect-init -- display the init system Ceph should use
============================================================

.. program:: ceph-detect-init

Synopsis
========

| **ceph-detect-init** [--verbose] [--use-rhceph] [--default *init*]
Description
===========

:program:`ceph-detect-init` is a utility that prints the init system
Ceph uses. It can be one of ``sysvinit``, ``upstart`` or ``systemd``.
The init system Ceph uses may not be the default init system of the
host operating system. For instance on Debian Jessie, Ceph may use
``sysvinit`` although ``systemd`` is the default.

If the init system of the host operating system is unknown, return on
error, unless :option:`--default` is specified.

Options
=======

.. option:: --use-rhceph

When an operating system identifies itself as Red Hat, it is
treated as if it was CentOS. With :option:`--use-rhceph` it is
treated as RHEL instead.

.. option:: --default INIT

If the init system of the host operating system is unkown, return
the value of *INIT* instead of failing with an error.

.. option:: --verbose

Display additional information for debugging.

Availability
============

:program:`ceph-detect-init` is part of Ceph, a massively scalable, open-source, distributed storage system. Please refer to
the Ceph documentation at http://ceph.com/docs for more information.

See also
========

:doc:`ceph-disk <ceph-disk>`\(8),
:doc:`ceph-deploy <ceph-deploy>`\(8)
1 change: 1 addition & 0 deletions man/Makefile-server.am
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ endif
if WITH_OSD
dist_man_MANS += \
ceph-clsinfo.8 \
ceph-detect-init.8 \
ceph-disk.8 \
ceph-osd.8 \
osdmaptool.8
Expand Down
1 change: 1 addition & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ endif
include arch/Makefile.am
include auth/Makefile.am
include brag/Makefile.am
include ceph-detect-init/Makefile.am
include crush/Makefile.am
include mon/Makefile.am
include mds/Makefile.am
Expand Down
69 changes: 69 additions & 0 deletions src/ceph-detect-init/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#
# Copyright (C) 2015 SUSE LINUX GmbH
# Copyright (C) 2015 <[email protected]>
#
# Author: Owen Synge <[email protected]>
# Author: Loic Dachary <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see `<http://www.gnu.org/licenses/>`.
#
check_SCRIPTS += ceph-detect-init/run-tox.sh

EXTRA_DIST += \
ceph-detect-init/AUTHORS.rst \
ceph-detect-init/ceph_detect_init/centos/__init__.py \
ceph-detect-init/ceph_detect_init/exc.py \
ceph-detect-init/ceph_detect_init/main.py \
ceph-detect-init/ceph_detect_init/__init__.py \
ceph-detect-init/ceph_detect_init/rhel/__init__.py \
ceph-detect-init/ceph_detect_init/fedora/__init__.py \
ceph-detect-init/ceph_detect_init/debian/__init__.py \
ceph-detect-init/ceph_detect_init/suse/__init__.py \
ceph-detect-init/integration/centos-6.dockerfile \
ceph-detect-init/integration/debian-wheezy.dockerfile \
ceph-detect-init/integration/debian-sid.dockerfile \
ceph-detect-init/integration/debian-jessie.dockerfile \
ceph-detect-init/integration/opensuse-13.1.dockerfile \
ceph-detect-init/integration/fedora-21.dockerfile \
ceph-detect-init/integration/ubuntu-14.04.dockerfile \
ceph-detect-init/integration/test_main.py \
ceph-detect-init/integration/opensuse-13.2.dockerfile \
ceph-detect-init/integration/ubuntu-12.04.dockerfile \
ceph-detect-init/integration/centos-7.dockerfile \
ceph-detect-init/integration/ubuntu-15.04.dockerfile \
ceph-detect-init/integration/debian-squeeze.dockerfile \
ceph-detect-init/Makefile.am \
ceph-detect-init/MANIFEST.in \
ceph-detect-init/README.rst \
ceph-detect-init/requirements.txt \
ceph-detect-init/run-tox.sh \
ceph-detect-init/setup.py \
ceph-detect-init/test-requirements.txt \
ceph-detect-init/tests/test_all.py \
ceph-detect-init/tox.ini

all-local::
cd ceph-detect-init ; python setup.py build

clean-local::
cd ceph-detect-init ; python setup.py clean ; rm -fr wheelhouse .tox build .coverage *.egg-info

install-data-local::
cd ceph-detect-init ; \
if lsb_release -si | grep --quiet 'Ubuntu\|Debian\|Devuan' ; then \
options=--install-layout=deb ; \
else \
options=--prefix=/usr ; \
fi ; \
python setup.py install --root=$(DESTDIR) $$options
5 changes: 4 additions & 1 deletion src/ceph-disk
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,10 @@ def which(executable):

for location in locations:
executable_path = os.path.join(location, executable)
if os.path.exists(executable_path):
LOG.debug('does ' + executable_path + ' exists ?')
if (os.path.isfile(executable_path) and
os.access(executable_path, os.X_OK)):
LOG.debug('yes, ' + executable_path + ' exists')
return executable_path


Expand Down

0 comments on commit 35a16ff

Please sign in to comment.