]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
5 years agoceph.spec.in: s/pkgversion/version_nodots/ 30722/head
Kefu Chai [Fri, 30 Aug 2019 11:49:28 +0000 (19:49 +0800)]
ceph.spec.in: s/pkgversion/version_nodots/

`python3_pkgversion` is now defined as 3, while we don't have packages
like python3-Cython yet in EPEL7. but we do have `python36-Cython`. so
let's use `python3_version_nodots` instead.

Signed-off-by: Kefu Chai <kchai@redhat.com>
Conflicts:
ceph.spec.in

5 years agoinstall-deps: do not install if rpm already installed
Kefu Chai [Fri, 27 Sep 2019 02:26:54 +0000 (10:26 +0800)]
install-deps: do not install if rpm already installed

there is chance that the system already have epel-release-latest-7.noarch.rpm
installed, in that case, install-deps.sh should not fail.

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 45a4173bcfe15a9bf56f6aeb6e6c35386a00d1c5)

5 years agoinstall-deps.sh: add EPEL repo for non-x86_64 archs as well
Nathan Cutler [Tue, 24 Sep 2019 19:48:27 +0000 (21:48 +0200)]
install-deps.sh: add EPEL repo for non-x86_64 archs as well

Fixes: https://tracker.ceph.com/issues/42023
Signed-off-by: Kefu Chai <kchai@redhat.com>
Signed-off-by: Nathan Cutler <ncutler@suse.com>
(cherry picked from commit 49d740118f9a0ee6b6bb82954630c654946f1751)

Conflicts:
install-deps.sh

5 years agoinstall-deps.sh: use latest setuptools
Kefu Chai [Sat, 26 Jan 2019 17:20:53 +0000 (01:20 +0800)]
install-deps.sh: use latest setuptools

this change reverts "install-deps.sh: workaround setuptools' dependency on six"

This reverts commit 30ce5e55460e333e1240704112a16fae68b3325f.

tl;dr: this change addresses the failures of "make check" runs on arm64
builders when they try to build `mgr-dashboard-test-venv` target.

long story: without this change, we will fail to pull in
setuptools >= 36, and as a result pip will fail to import
`setuptools.build_meta` in `pip/_vendor/pep517/_in_process.py`. and will
a `BackendUnavailable` exception thrown by `_call_hook()` in
`pip/_vendor/pep517/wrappers.py`. since the issue addressed by 30ce5e55
has been addressed since setuptools >= 36.0.1, we should be safe to
upgrade to the latest setuptools now.

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 8b55b47cc75e43ef683cd230f792cd92f1c46fa7)

5 years agoinstall-deps.sh: skip unavailable repos
Kefu Chai [Wed, 19 Dec 2018 08:37:55 +0000 (16:37 +0800)]
install-deps.sh: skip unavailable repos

as centos-sclo-rh-source leads us to 404 at this moment. and we are not
using the source repo for building ceph. so we can just skip any
unavailable repo.

Fixes: http://tracker.ceph.com/issues/37707
Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
(cherry picked from commit aa2b9e9a643441d9a2891e17920677a7725754c4)

5 years agoinstall-deps: install setuptools before upgrading virtualenv
Kefu Chai [Sat, 10 Nov 2018 21:33:43 +0000 (13:33 -0800)]
install-deps: install setuptools before upgrading virtualenv

this should address the failures when running install-deps.sh, like

Downloading/unpacking virtualenv
  Running setup.py egg_info for package virtualenv
    /usr/lib64/python2.7/distutils/dist.py:267: UserWarning: Unknown
distribution option: 'python_requires'
      warnings.warn(msg)
    error in virtualenv setup command: 'extras_require' must be a
dictionary whose values are strings or lists of strings containing valid
project/version requirement specifiers.
    Complete output from command python setup.py egg_info:
    /usr/lib64/python2.7/distutils/dist.py:267: UserWarning: Unknown
distribution option: 'python_requires'

  warnings.warn(msg)

error in virtualenv setup command: 'extras_require' must be a dictionary
whose values are strings or lists of strings containing valid
project/version requirement specifiers.

this only happens on very old virtualenv shipped with RHEL7.4

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 95386752ab2635f56e1d38b50de7144e2135b323)

5 years agobuild/ops: unify command substitution in install-deps.sh
Nathan Cutler [Wed, 1 Aug 2018 10:33:58 +0000 (12:33 +0200)]
build/ops: unify command substitution in install-deps.sh

The $() form is preferable to `` because folks (like me) might be using
` as a keyboard shortcut to GNU Screen, causing havoc to ensue whenever
copy-pasting the ` character.

Signed-off-by: Nathan Cutler <ncutler@suse.com>
(cherry picked from commit e0042dd617269934bf51efee5bab7e4485875576)

Conflicts:
install-deps.sh
- include a part of b6d9464806b74c9f40e03258a004921f472d122e

5 years agoinstall-deps: check the exit status for the $builddepcmd
Yunchuan Wen [Sun, 24 Jun 2018 01:48:50 +0000 (09:48 +0800)]
install-deps: check the exit status for the $builddepcmd

in some case, the $builddepcmd will failed without any "error:" output.
so we should check the exit status to handle it.

Signed-off-by: Yunchuan Wen <yunchuan.wen@kylin-cloud.com>
(cherry picked from commit 46e33d15a4132772a6bd11cd49f4181081bcdd55)

5 years agoinstall-deps: fix installing gcc on ubuntu when no old compiler
Tomasz Setkowski [Sat, 14 Apr 2018 15:23:58 +0000 (15:23 +0000)]
install-deps: fix installing gcc on ubuntu when no old compiler

Signed-off-by: Tomasz Setkowski <tom@ai-traders.com>
(cherry picked from commit 0d8d0cf6f7594f4f97677a2069998331998bdfa9)

5 years agoinstall-deps.sh: support install gcc7 in xenial aarch64
Yunchuan Wen [Thu, 7 Jun 2018 07:51:31 +0000 (15:51 +0800)]
install-deps.sh: support install gcc7 in xenial aarch64

Signed-off-by: Yunchuan Wen <yunchuan.wen@kylin-cloud.com>
(cherry picked from commit f92f256f4503d19f41b7c300a4df46b189e81a9b)

5 years agoinstall-deps: nuke wheelhouse if it's stale
Kefu Chai [Wed, 16 May 2018 11:41:52 +0000 (19:41 +0800)]
install-deps: nuke wheelhouse if it's stale

otherwise, if we update *requirements.txt, and the wheelhouse fails to
offer the newly added dependency, the setup-virtualenv.sh will fail the
build.

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit ed0ca70707439f44779ca7093461182d73db1a77)

5 years agoinstall-deps.sh: Fixes for RHEL 7
Zack Cerza [Fri, 1 Feb 2019 00:36:17 +0000 (00:36 +0000)]
install-deps.sh: Fixes for RHEL 7

Signed-off-by: Zack Cerza <zack@redhat.com>
(cherry picked from commit a1a3e7960cf2c792ac8c9c71e68caa0ebada8933)

Conflicts:
install-deps.sh

5 years agoinstall-deps.sh: install `python*-devel` for python*rpm-macros
Kefu Chai [Thu, 5 Sep 2019 15:17:06 +0000 (23:17 +0800)]
install-deps.sh: install `python*-devel` for python*rpm-macros

in 087ea813, we installed '*rpm-macros' for the macros, so we can have
access to the latest python packaging related macros for preparing the
build dependencies.

but we could run into https://bugs.centos.org/view.php?id=16379, if
we already have an old version of python-devel installed. as the newer
version of python-rpm-macros conflicts with it.

it was a chicken-and-egg problem, as we don't know the exact name of
*rpm-macros packages. that's why we chose to install all of them. but
we have to upgrade the existing python-devel package to resolve the
conflict. but the since there is no python3-devel in RHEL7/CentOS7,
what they have is python36-devel. so we have to hardwire the
`%{python3_pkgversion}` to "36" even before we have access to this
macro, and upgrade the python36-devel package beforehand. but this
renders installing the rpm-macro package less useful -- we intend to
use the macro offered by the package to figure out "36".

as a workaround, we pretend that we know the "main" version of python3
in current RHEL/CentOS. and always install python36-devel for
python-rpm-macros. as the former requires the latter.

once all python3*-devel on all builders are upgraded, we will be safe
to install '*rpm-macros' again without installing python36-devel first.
by then, we could revert this change, or continue installing
python36-devel until the distro bumps up the "main" python version to 3.7

Fixes: https://tracker.ceph.com/issues/41603
Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 0b2be2b6710695867197ee84e411bdf0a843a06a)

Conflicts:
install-deps.sh
- VERSION_ID in luminous, MAJOR_VERSION in master

5 years agoinstall-deps.sh: Remove CR repo
Brad Hubbard [Thu, 22 Nov 2018 00:07:22 +0000 (10:07 +1000)]
install-deps.sh: Remove CR repo

Remove the continuous release repos for CentOS and Virtuozzo 7 as they
should no longer be needed since http://tracker.ceph.com/issues/13997 is
no longer relevant and the newer versions of selinux packages pulled in
by the build system are causing problems for systems without CR repos
enabled.

Fixes: https://tracker.ceph.com/issues/37335
Signed-off-by: Alfredo Deza <adeza@redhat.com>
Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
(cherry picked from commit f39d9b7d1f4f2b63233802211a9ed0e641446ca1)

5 years agobuild/ops: refrain from installing/using lsb_release in install-deps.sh
Nathan Cutler [Wed, 1 Aug 2018 10:52:45 +0000 (12:52 +0200)]
build/ops: refrain from installing/using lsb_release in install-deps.sh

Unfortunately the mapping between release number and codename (which is only
relevant for Debian and Ubuntu btw) is not available from /etc/os-release.
In that one respect, lsb_release was "better".

However, when I weigh the advantages of obtaining that mapping from an external
tool, with the (substantial) risk that the external dependency might cause
trouble on one or more supported distros (to say nothing of the non- or
semi-/pseudo-supported ones), against the work involved in maintaining a
hard-coded mapping (negligible), the needle on my scale immediately swings
toward eliminating the dependency.

Also, I see this commit as part of the longer-term effort to completely expunge
lsb_release from our codebase. See git log --grep lsb_release.

For another example of an external distro-detection tool (albeit one that was
included in Python 2) gone awry, see http://tracker.ceph.com/issues/18163.

Signed-off-by: Nathan Cutler <ncutler@suse.com>
(cherry picked from commit 38508b41dc7f33a0b35e3633be3da1d2dae844dc)

Conflicts:
install-deps.sh

5 years agoinstall-deps.sh: fix an error condition expression
Yao Guotao [Fri, 9 Mar 2018 09:46:27 +0000 (04:46 -0500)]
install-deps.sh: fix an error condition expression

Signed-off-by: Yao Guotao <yaoguot@gmail.com>
(cherry picked from commit b3a59490311ee1f5bbc5b34ac5c8a1c31b34a5de)

5 years agoscripts: install-deps.sh: pass --no-recommends to zypper
Nathan Cutler [Wed, 14 Feb 2018 10:49:03 +0000 (11:49 +0100)]
scripts: install-deps.sh: pass --no-recommends to zypper

Fixes: http://tracker.ceph.com/issues/22998
Signed-off-by: Nathan Cutler <ncutler@suse.com>
(cherry picked from commit b47d57474dbc9d5ed9357457e3098bb6a1386d55)

5 years agoinstall-deps.sh: check if have access to stdout
Kefu Chai [Thu, 28 Dec 2017 02:18:11 +0000 (10:18 +0800)]
install-deps.sh: check if have access to stdout

$- is "hB" if launched via command line, and it is "himBH" only when
we are actually *in* an interactive shell. so checking "test -t 1" is
what we want.

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 7bb8f66cf4e2519c33f1078c1be7485f9fe35a87)

5 years agoinstall-deps: bump DTS version on aarch64 to 7
Kefu Chai [Fri, 22 Dec 2017 05:04:28 +0000 (13:04 +0800)]
install-deps: bump DTS version on aarch64 to 7

see https://bugs.centos.org/view.php?id=14078

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit d38a9370b692bbd44b58f12995e88c73956ef36f)

5 years agoinstall-deps.sh: enable testing repo on centos on aarch64
Kefu Chai [Fri, 8 Dec 2017 10:07:37 +0000 (18:07 +0800)]
install-deps.sh: enable testing repo on centos on aarch64

the DTS-6 is only available in the testing repo

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 4cedada14e12e677a180cfa1fce6442ecc763204)

5 years agoinstall-deps.sh: use DTS on centos if GCC is too old
Kefu Chai [Fri, 8 Dec 2017 08:34:59 +0000 (16:34 +0800)]
install-deps.sh: use DTS on centos if GCC is too old

please note, run-make-check.sh sources install-deps.sh here to import
the $PATH and other environmental variables, which could be changed by
the the DTS "enable" script.

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 3f8647a7e80b20079bec97d5be12372909083bb4)

Conflicts:
install-deps.sh
run-make-check.sh
- RH/CentOS changes only

5 years agoinstall-deps.sh: install centos-release-scl-rh on aarch64
Kefu Chai [Tue, 5 Dec 2017 15:22:17 +0000 (23:22 +0800)]
install-deps.sh: install centos-release-scl-rh on aarch64

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 84660c977cc7511290a3c5497468052b3eaccf43)

5 years agoinstall-deps.sh: always use yum-config-manager for consistency
Kefu Chai [Fri, 10 Nov 2017 12:03:25 +0000 (20:03 +0800)]
install-deps.sh: always use yum-config-manager for consistency

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit eccc961c728153c928baa4478e9c8d5a1139a834)

5 years agoinstall-deps.sh: install devtoolset-7 for centos/rhel
Kefu Chai [Fri, 10 Nov 2017 01:32:13 +0000 (09:32 +0800)]
install-deps.sh: install devtoolset-7 for centos/rhel

ready them for gcc7 and libstdc++-7 for better performance.

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit f9aa49cee15cd571a8dc2efcd46a54b0a1f68f89)

Conflicts:
install-deps.sh
- leave shebang untouched: 3aae5ca6fda8b07ef875ae47c1b620aa3e2cdcd9 is not being
  backported

5 years agoinstall-deps: Add Virtuozzo Linux support
Andrey Parfenov [Mon, 3 Apr 2017 13:35:49 +0000 (16:35 +0300)]
install-deps: Add Virtuozzo Linux support

Signed-off-by: Andrey Parfenov <aparfenov@virtuozzo.com>
(cherry picked from commit 46bdb32bcd65146c5f4269ac094f12c0b5472de7)

5 years agobuild/ops: enable CR in CentOS 7
Loic Dachary [Tue, 8 Dec 2015 07:02:56 +0000 (08:02 +0100)]
build/ops: enable CR in CentOS 7

To get libunwind from the CR repositories until CentOS 7.2.1511 is released.

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

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit 247ee6084b58861da601d349bdba739b252d96de)

5 years agoMerge pull request #28991 from smithfarm/wip-40249
Jason Dillaman [Thu, 3 Oct 2019 21:06:00 +0000 (17:06 -0400)]
Merge pull request #28991 from smithfarm/wip-40249

luminous: tests: qa/rados/upgrade/jewel-x-singleton: set RBD_FEATURES

Reviewed-by: Jason Dillaman <dillaman@redhat.com>
5 years agoqa/rados/upgrade/jewel-x-singleton: do not run on Bionic 28991/head
Nathan Cutler [Wed, 2 Oct 2019 12:19:04 +0000 (14:19 +0200)]
qa/rados/upgrade/jewel-x-singleton: do not run on Bionic

The test was failing because it did not explicitly set "os_type" and
"os_version", and teuthology defaulted to Ubuntu Bionic.

Jewel is not supported on Ubuntu Bionic, so we should not try to run tests on
that Ubuntu version.

NOTE: This commit is not cherry-picked from master because the fix is
luminous-specific (there is no "rados/upgrade/jewel-x-singleton" test after
luminous).

Signed-off-by: Nathan Cutler <ncutler@suse.com>
5 years agoqa/rados/upgrade/jewel-x-singleton: set RBD_FEATURES
Nathan Cutler [Thu, 11 Jul 2019 13:29:17 +0000 (15:29 +0200)]
qa/rados/upgrade/jewel-x-singleton: set RBD_FEATURES

This commit cannot be cherry-picked from master because luminous is the only
non-EOL stable branch that still includes the
qa/rados/upgrade/jewel-x-singleton suite.

Fixes: https://tracker.ceph.com/issues/40249
Signed-off-by: Nathan Cutler <ncutler@suse.com>
5 years agoMerge pull request #30665 from smithfarm/wip-42106-luminous
Nathan Cutler [Wed, 2 Oct 2019 09:10:17 +0000 (11:10 +0200)]
Merge pull request #30665 from smithfarm/wip-42106-luminous

luminous: build/ops: admin/build-doc: use python3

Reviewed-by: Kefu Chai <kchai@redhat.com>
5 years agoMerge pull request #24169 from tchaikov/wip-17516-luminous
Kefu Chai [Wed, 2 Oct 2019 03:50:29 +0000 (11:50 +0800)]
Merge pull request #24169 from tchaikov/wip-17516-luminous

luminous: cmake: pass -march to detect compiler support of arm64 crc/crypto

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
5 years agoMerge pull request #26247 from liewegas/wip-bluestore-disable-csum-luminous
Yuri Weinstein [Wed, 2 Oct 2019 00:09:05 +0000 (17:09 -0700)]
Merge pull request #26247 from liewegas/wip-bluestore-disable-csum-luminous

luminous: bluestore: add bluestore_ignore_data_csum option

Reviewed-by: Igor Fedotov <ifedotov@suse.com>
5 years agoMerge pull request #29859 from athanatos/sjust/wip-luminous-20924
Yuri Weinstein [Wed, 2 Oct 2019 00:08:12 +0000 (17:08 -0700)]
Merge pull request #29859 from athanatos/sjust/wip-luminous-20924

luminous:  mds,osd,mon,msg: use intrusive_ptr for holding Connection::priv

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
5 years agoMerge pull request #27557 from smithfarm/wip-39277-luminous
Yuri Weinstein [Tue, 1 Oct 2019 22:59:49 +0000 (15:59 -0700)]
Merge pull request #27557 from smithfarm/wip-39277-luminous

luminous:  platform.linux_distribution() is deprecated; stop using it

Reviewed-by: Kefu Chai <kchai@redhat.com>
Reviewed-by: Tim Serong <tserong@suse.com>
5 years agoMerge pull request #27912 from ifed01/wip-ifed-fix-39565
Yuri Weinstein [Tue, 1 Oct 2019 22:59:01 +0000 (15:59 -0700)]
Merge pull request #27912 from ifed01/wip-ifed-fix-39565

luminous: os/bluestore_tool: bluefs-bdev-expand: indicate bypassed for main dev

Reviewed-by: Sage Weil <sage@redhat.com>
5 years agoMerge pull request #29025 from ifed01/wip-ifed-fix-stupid-len0-lum
Yuri Weinstein [Tue, 1 Oct 2019 22:58:39 +0000 (15:58 -0700)]
Merge pull request #29025 from ifed01/wip-ifed-fix-stupid-len0-lum

luminous: os/bluestore: avoid length overflow in extents returned by Stupid Alloc

Reviewed-by: Ilya Dryomov <idryomov@redhat.com>
Reviewed-by: Sage Weil <sage@redhat.com>
5 years agoMerge pull request #29248 from smithfarm/wip-38436-luminous
Yuri Weinstein [Tue, 1 Oct 2019 22:58:08 +0000 (15:58 -0700)]
Merge pull request #29248 from smithfarm/wip-38436-luminous

luminous: crc cache should be invalidated when posting preallocated rx buffers

Reviewed-by: Neha Ojha <nojha@redhat.com>
Reviewed-by: Ilya Dryomov <idryomov@redhat.com>
5 years agoMerge pull request #29366 from dzafman/wip-37748
Yuri Weinstein [Tue, 1 Oct 2019 22:57:32 +0000 (15:57 -0700)]
Merge pull request #29366 from dzafman/wip-37748

luminous: tools: Add clear-data-digest command to objectstore tool.

Reviewed-by: Neha Ojha <nojha@redhat.com>
5 years agoMerge pull request #28812 from trociny/wip-40592-luminous
Yuri Weinstein [Tue, 1 Oct 2019 20:50:08 +0000 (13:50 -0700)]
Merge pull request #28812 from trociny/wip-40592-luminous

luminous: rbd-mirror: handle duplicates in image sync throttler queue

Reviewed-by: Jason Dillaman <dillaman@redhat.com>
5 years agoadmin/build-doc: use python3 30665/head
Kefu Chai [Wed, 7 Aug 2019 09:46:13 +0000 (17:46 +0800)]
admin/build-doc: use python3

to address https://github.com/sphinx-doc/sphinx/issues/3620, we need to
use sphinx with its fix at
https://github.com/sphinx-doc/sphinx/commit/e049f86b2de1cfdf8a74c88dc9593d047c85d5cb
in other words, we need to use sphinx v2.0.0 and up. but sphinx 2.0
requires python >= 3.5, so we have to use python3 for building the
documents.

in this change:

* doc-requirements.txt: install python3 packages on debian derivatives
* build-doc: install python3.6 packages from EPEL7, and use python3
  venv for using sphinx2
* doc-requirements.txt: bump up all python packages to latest
  stable.

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit ace8cb15a600daf5261c0ab349b43010a238a1d9)

Conflicts:
admin/doc-requirements.txt
admin/build-doc

5 years agoadmin/build-doc: support renamed python2 RPMs
Jason Dillaman [Thu, 4 Jan 2018 14:55:16 +0000 (09:55 -0500)]
admin/build-doc: support renamed python2 RPMs

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit f309180b961094e1e3ab88b76eb113578b07d752)

5 years agoMerge pull request #27639 from wumingqiao/luminous
Kefu Chai [Sun, 29 Sep 2019 07:28:55 +0000 (15:28 +0800)]
Merge pull request #27639 from wumingqiao/luminous

luminous: mgr: drop GIL in StandbyPyModule::get_config

Reviewed-by: Brad Hubbard <bhubbard@redhat.com>
Reviewed-by: xie xingguo <xie.xingguo@zte.com.cn>
Reviewed-by: Kefu Chai <kchai@redhat.com>
5 years agoMerge pull request #29736 from smithfarm/wip-41334-luminous
Nathan Cutler [Thu, 26 Sep 2019 11:14:33 +0000 (13:14 +0200)]
Merge pull request #29736 from smithfarm/wip-41334-luminous

luminous: build/ops: ceph-test RPM not built for SUSE

Reviewed-by: Kefu Chai <kchai@redhat.com>
Reviewed-by: Kyr Shatskyy <kyrylo.shatskyy@suse.de>
5 years agoMerge pull request #30556 from alfredodeza/luminous-guits-41392
Jan Fajerski [Wed, 25 Sep 2019 07:10:49 +0000 (09:10 +0200)]
Merge pull request #30556 from alfredodeza/luminous-guits-41392

luminous ceph-volume: do not fail when trying to remove crypt mapper

5 years agoceph-volume: do not fail when trying to remove crypt mapper 30556/head
Guillaume Abrioux [Fri, 20 Sep 2019 12:57:58 +0000 (14:57 +0200)]
ceph-volume: do not fail when trying to remove crypt mapper

In a containerized context, at some point, need to run `simple scan` on a device
from a separate container (not the existing and running corresponding container
to that device), but this can't work because when it tries to remove the
mapper which is still in use by the corresponding running osd container,
it fails.
This can be a bit more permissive and simply throw a warning.

Closes: https://tracker.ceph.com/issues/41392
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 80d3e4ca054b4d1334c2fb99fede46ab54ca4305)

5 years agoMerge pull request #29038 from dcasier/wip-40100-luminous
Alfredo Deza [Thu, 12 Sep 2019 21:52:54 +0000 (17:52 -0400)]
Merge pull request #29038 from dcasier/wip-40100-luminous

luminous: ceph-volume: lvm.activate: Return an error if WAL/DB devices absent

Reviewed-by: Alfredo Deza <adeza@redhat.com>
5 years agoceph-volume: lvm.activate: Return an error if WAL/DB devices absent 29038/head
David Casier [Wed, 3 Jul 2019 21:24:34 +0000 (23:24 +0200)]
ceph-volume: lvm.activate: Return an error if WAL/DB devices absent

Fixes: https://tracker.ceph.com/issues/40100
Signed-off-by: David Casier <david.casier@aevoo.fr>
(cherry picked from commit de439a0a236e4752e64a0cd63b7ce1ad3278eff3)

5 years agoMerge pull request #29771 from alfredodeza/luminous-bz-1738379
Jan Fajerski [Thu, 12 Sep 2019 13:00:16 +0000 (15:00 +0200)]
Merge pull request #29771 from alfredodeza/luminous-bz-1738379

luminous ceph-volume: use the OSD identifier when reporting success

5 years agoMerge pull request #30296 from alfredodeza/luminous-rm41378-2
Alfredo Deza [Thu, 12 Sep 2019 10:55:35 +0000 (06:55 -0400)]
Merge pull request #30296 from alfredodeza/luminous-rm41378-2

luminous ceph-volume: pre-install python-apt and its variants before test runs

Reviewed-by: Jan Fajerski <jfajerski@suse.com>
5 years agoMerge pull request #30305 from alfredodeza/luminous-rm40664
Jan Fajerski [Thu, 12 Sep 2019 10:05:25 +0000 (12:05 +0200)]
Merge pull request #30305 from alfredodeza/luminous-rm40664

luminous ceph-volume  zap always skips block.db, leaves them around

5 years agoMerge pull request #30299 from alfredodeza/luminous-rm41660
Alfredo Deza [Wed, 11 Sep 2019 19:30:36 +0000 (15:30 -0400)]
Merge pull request #30299 from alfredodeza/luminous-rm41660

luminous ceph-volume: fix stderr failure to decode/encode when redirected

Reviewed-by: Andrew Schoen <aschoen@redhat.com>
5 years agoceph-volume tests create a test file for checking unicode output 30299/head
Alfredo Deza [Mon, 9 Sep 2019 22:55:13 +0000 (18:55 -0400)]
ceph-volume tests create a test file for checking unicode output

Signed-off-by: Alfredo Deza <adeza@redhat.com>
(cherry picked from commit 79196354aca3b3d30c7de1e2ac8b5a3c06ee8330)

5 years agoceph-volume tests create a shell test for functional unicode
Alfredo Deza [Mon, 9 Sep 2019 22:54:51 +0000 (18:54 -0400)]
ceph-volume tests create a shell test for functional unicode

Signed-off-by: Alfredo Deza <adeza@redhat.com>
(cherry picked from commit 595e492783283359b613d199a75f3e7495bfb9ed)

5 years agoceph-volume tests verify new logging fallback and encodings in terminal
Alfredo Deza [Mon, 9 Sep 2019 19:20:13 +0000 (15:20 -0400)]
ceph-volume tests verify new logging fallback and encodings in terminal

Signed-off-by: Alfredo Deza <adeza@redhat.com>
(cherry picked from commit ee18ebc078b2d380b88f3726737184f34345e2f3)

5 years agoceph-volume terminal remove unicode stream handler
Alfredo Deza [Mon, 9 Sep 2019 17:45:08 +0000 (13:45 -0400)]
ceph-volume terminal remove unicode stream handler

This caused problems in environments where stderr was redirected, since
stderr sets the encoding to None. Getting it back again allows
everything to work correctly, and keeps all the current unit tests
passing

Signed-off-by: Alfredo Deza <adeza@redhat.com>
(cherry picked from commit fe66e01f6a4b19bb15695537713a629a951b28ce)

5 years agoceph-volume: instantiate the new terminal logger in main()
Alfredo Deza [Mon, 9 Sep 2019 17:44:36 +0000 (13:44 -0400)]
ceph-volume: instantiate the new terminal logger in main()

Signed-off-by: Alfredo Deza <adeza@redhat.com>
(cherry picked from commit bfb8422e262dcce49c50610a3977bfe1edc2a435)

5 years agoceph-volume create a logger for the terminal
Alfredo Deza [Mon, 9 Sep 2019 17:44:17 +0000 (13:44 -0400)]
ceph-volume create a logger for the terminal

Signed-off-by: Alfredo Deza <adeza@redhat.com>
(cherry picked from commit 95b16b516c0736839fe50f12ecbeb7cd62c67335)

5 years agoceph-volume create a new tox.ini for shell-based tests
Alfredo Deza [Mon, 9 Sep 2019 17:40:06 +0000 (13:40 -0400)]
ceph-volume create a new tox.ini for shell-based tests

Signed-off-by: Alfredo Deza <adeza@redhat.com>
(cherry picked from commit 4612ab3ae62a3e8e1cc9e51489feab0c938296d3)

5 years agoMerge pull request #30302 from alfredodeza/luminous-ceph-volume-zap-fix
Alfredo Deza [Wed, 11 Sep 2019 13:31:13 +0000 (09:31 -0400)]
Merge pull request #30302 from alfredodeza/luminous-ceph-volume-zap-fix

luminous ceph-volume lvm.zap fix cleanup for db partitions

Reviewed-by: Jan Fajerski <jfajerski@suse.com>
5 years agoceph-volume lvm.zap fix cleanup for db partitions 30302/head
Dominik Csapak [Tue, 28 May 2019 14:29:21 +0000 (16:29 +0200)]
ceph-volume lvm.zap fix cleanup for db partitions

this uses the correct type 'db' for db type partitions, else
a block.db parition does not get cleaned up by ceph-volume zap

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
(cherry picked from commit 140af8a7eee8d230ac9d94ba100320a20c137a12)

5 years agoMerge pull request #30331 from jan--f/wip-9e2175c-luminous
Alfredo Deza [Wed, 11 Sep 2019 12:54:34 +0000 (08:54 -0400)]
Merge pull request #30331 from jan--f/wip-9e2175c-luminous

luminous: ceph-volume: set a lvm_size property on the fakedevice fixture

Reviewed-by: Alfredo Deza <adeza@redhat.com>
5 years agoceph-volume: set a lvm_size property on the fakedevice fixture 30331/head
Andrew Schoen [Thu, 6 Dec 2018 18:37:56 +0000 (12:37 -0600)]
ceph-volume: set a lvm_size property on the fakedevice fixture

This is so tests can continue to set sys_api['size'] and the code
can retrieve that as Device.lvm_size

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
(cherry picked from commit 9e2175c4001434f7b0ed8ce6f723e063cf001440)

5 years agoceph-volume tests: verify that wipefs tries several times 30305/head
Alfredo Deza [Thu, 11 Jul 2019 15:56:07 +0000 (11:56 -0400)]
ceph-volume tests: verify that wipefs tries several times

Signed-off-by: Alfredo Deza <adeza@redhat.com>
(cherry picked from commit 845e62cb4ba2636325304db2c2d65a185ace25cf)

5 years agoceph-volume lvm.zap: retry wipefs several times to prevent race condition failures
Alfredo Deza [Thu, 11 Jul 2019 13:34:10 +0000 (09:34 -0400)]
ceph-volume lvm.zap: retry wipefs several times to prevent race condition failures

Signed-off-by: Alfredo Deza <adeza@redhat.com>
(cherry picked from commit b7b8b106fa485d3b8345b583fbc7f74e30cbc03e)

5 years agoceph-volume tests pre-instrall python-apt to prevent auto-install failing later 30296/head
Alfredo Deza [Tue, 3 Sep 2019 14:00:14 +0000 (10:00 -0400)]
ceph-volume tests pre-instrall python-apt to prevent auto-install failing later

Signed-off-by: Alfredo Deza <adeza@redhat.com>
(cherry picked from commit 40cac7b9510f7904c2f9dfb1294d809e04bdcf7e)

5 years agoMerge pull request #30129 from smithfarm/wip-41644-luminous
Nathan Cutler [Mon, 9 Sep 2019 22:29:13 +0000 (00:29 +0200)]
Merge pull request #30129 from smithfarm/wip-41644-luminous

luminous: install-deps.sh: Remove CR repo

Reviewed-by: Kefu Chai <kchai@redhat.com>
Reviewed-by: Brad Hubbard <bhubbard@redhat.com>
5 years agoMerge pull request #29910 from vumrao/wip-vumrao-bluefs-log-level
Neha Ojha [Mon, 9 Sep 2019 19:12:52 +0000 (12:12 -0700)]
Merge pull request #29910 from vumrao/wip-vumrao-bluefs-log-level

luminous: os/bluestore: apply shared_alloc_size to shared device with log level change

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
Reviewed-by: Igor Fedotov <ifedotov@suse.com>
Reviewed-by: Adam Kupczyk <akupczyk@redhat.com>
5 years agoMerge pull request #29190 from badone/wip-luminous-lazy-omap-stats-backport-tracker...
Neha Ojha [Mon, 9 Sep 2019 17:36:12 +0000 (10:36 -0700)]
Merge pull request #29190 from badone/wip-luminous-lazy-omap-stats-backport-tracker-38551

luminous: core: lazy omap stat collection

Reviewed-by: Sage Weil <sage@redhat.com>
Reviewed-by: Josh Durgin <jdurgin@redhat.com>
5 years agoMerge pull request #29175 from neha-ojha/wip-40583-luminous 30169/head
Neha Ojha [Sat, 7 Sep 2019 19:17:30 +0000 (12:17 -0700)]
Merge pull request #29175 from neha-ojha/wip-40583-luminous

luminous: common/options.cc: Lower the default value of osd_deep_scrub_large_omap_object_key_threshold

Reviewed-by: Sage Weil <sage@redhat.com>
Reviewed-by: David Zafman <dzafman@redhat.com>
5 years agoMerge pull request #30149 from neha-ojha/wip-40769-luminous
Neha Ojha [Fri, 6 Sep 2019 17:10:42 +0000 (10:10 -0700)]
Merge pull request #30149 from neha-ojha/wip-40769-luminous

luminous: common/options: Set concurrent bluestore rocksdb compactions to 2

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
5 years agocommon/options: Set concurrent bluestore rocksdb compactions to 2 30149/head
Mark Nelson [Fri, 12 Jul 2019 16:45:17 +0000 (12:45 -0400)]
common/options: Set concurrent bluestore rocksdb compactions to 2

Signed-off-by: Mark Nelson <mnelson@redhat.com>
(cherry picked from commit 26dc5189e73a1f5a22f89ee67eef5430ef660b5d)

5 years agoinstall-deps.sh: Remove CR repo 30129/head
Brad Hubbard [Thu, 22 Nov 2018 00:07:22 +0000 (10:07 +1000)]
install-deps.sh: Remove CR repo

Remove the continuous release repos for CentOS and Virtuozzo 7 as they
should no longer be needed since http://tracker.ceph.com/issues/13997 is
no longer relevant and the newer versions of selinux packages pulled in
by the build system are causing problems for systems without CR repos
enabled.

Fixes: https://tracker.ceph.com/issues/37335
Signed-off-by: Alfredo Deza <adeza@redhat.com>
Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
(cherry picked from commit f39d9b7d1f4f2b63233802211a9ed0e641446ca1)

Conflicts:
install-deps.sh

5 years agoMerge pull request #30094 from jan--f/wip-41613-luminous
Alfredo Deza [Tue, 3 Sep 2019 17:51:42 +0000 (13:51 -0400)]
Merge pull request #30094 from jan--f/wip-41613-luminous

luminous: ceph-volume: lvm list is O(n^2)

Reviewed-by: Alfredo Deza <adeza@redhat.com>
5 years agoceph-volume: test number of times LVs list was created 30094/head
Rishabh Dave [Mon, 19 Aug 2019 13:33:21 +0000 (19:03 +0530)]
ceph-volume: test number of times LVs list was created

Add a test that cofirm that the LVs list was created only once when
calling devices.lvm.listing.list()

Signed-off-by: Rishabh Dave <ridave@redhat.com>
(cherry picked from commit 20d6264538dab444c0ef13f40c6c21ec3d2057f8)

5 years agoceph-volume: reuse list of LVs
Rishabh Dave [Wed, 14 Aug 2019 15:57:38 +0000 (21:27 +0530)]
ceph-volume: reuse list of LVs

Avoid creating of list of LVs in different methods of the same module
and resue them.

Fixes: https://tracker.ceph.com/issues/37490
Signed-off-by: Rishabh Dave <ridave@redhat.com>
(cherry picked from commit ab3a58e78124a984d162b2f63992d01c5e59e2a7)

5 years agoceph-volume devices.lvm zap use the identifier to report success 29771/head
Alfredo Deza [Tue, 20 Aug 2019 12:04:56 +0000 (08:04 -0400)]
ceph-volume devices.lvm zap use the identifier to report success

Signed-off-by: Alfredo Deza <adeza@redhat.com>
(cherry picked from commit d0d5750c1ba508152c1d5111f2003a039a27145f)

5 years agoceph-volume tests check success message when zapping
Alfredo Deza [Tue, 20 Aug 2019 12:04:26 +0000 (08:04 -0400)]
ceph-volume tests check success message when zapping

Signed-off-by: Alfredo Deza <adeza@redhat.com>
(cherry picked from commit 88c7429a60fdab6222d14132bea93b9bf773c720)

5 years agoosdc/Objecter: invalidate crcs on preallocated rx buffers 29248/head
Ilya Dryomov [Wed, 20 Feb 2019 21:30:29 +0000 (22:30 +0100)]
osdc/Objecter: invalidate crcs on preallocated rx buffers

Both simple and async messengers use c_str() when copying the data from
the socket into the receive buffer, going behind bufferlist's back.  If
the receive buffer is preallocated, we need to invalidate its crc cache
by hand to avoid possible data crc mismatches on the client side.

Fixes: https://tracker.ceph.com/issues/38416
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 3eeab975b604d9fc4290747f85a78d59a2452c2e)

Conflicts:
src/test/librados/io_cxx.cc
- In master, 3730d10623650ce8569be96b28cbba599a9a0db6 renamed this file from
  src/test/librados/io.cc but that commit is not being backported to luminous.
  Manually cherry-picked the test mods into src/test/librados/io.cc.

5 years agoMerge pull request #29901 from alfredodeza/luminous-rm41378
Alfredo Deza [Tue, 27 Aug 2019 11:49:26 +0000 (07:49 -0400)]
Merge pull request #29901 from alfredodeza/luminous-rm41378

luminous ceph-volume tests set the noninteractive flag for Debian

Reviewed-by: Andrew Schoen <aschoen@redhat.com>
5 years agoos/bluestore/BlueFS: Move bluefs alloc size initialization log message to log level 1 29910/head
Vikhyat Umrao [Thu, 22 Aug 2019 16:45:40 +0000 (09:45 -0700)]
os/bluestore/BlueFS: Move bluefs alloc size initialization log message to log level 1
Fixes: https://tracker.ceph.com/issues/41399
Signed-off-by: Vikhyat Umrao <vumrao@redhat.com>
(cherry picked from commit 96d48af3252f0ec2c1864383ad5eee993ecfeb4f)

5 years agoMerge pull request #29791 from jan--f/wip-41373-luminous
Alfredo Deza [Mon, 26 Aug 2019 15:53:49 +0000 (11:53 -0400)]
Merge pull request #29791 from jan--f/wip-41373-luminous

luminous: batch functional idempotency test fails since message is now on stderr

Reviewed-by: Alfredo Deza <adeza@redhat.com>
5 years agoceph-volume tests set the noninteractive flag for Debian, to avoid prompts in apt 29901/head
Alfredo Deza [Wed, 21 Aug 2019 18:15:32 +0000 (14:15 -0400)]
ceph-volume tests set the noninteractive flag for Debian, to avoid prompts in apt

Signed-off-by: Alfredo Deza <adeza@redhat.com>
(cherry picked from commit 89231c9a60a46ba0691f787efbfe5ab35f05c679)

5 years agoos/bluestore: record gifts < expected size in superblock 29860/head
Josh Durgin [Sat, 24 Aug 2019 02:52:52 +0000 (22:52 -0400)]
os/bluestore: record gifts < expected size in superblock

Returning 0 from _balance_bluefs_freespace() skips recording
allocations in the superblock, so we fail the consistency check on
startup. The elseif branch handles this case already, so just remove
it from the first branch. This is luminous/mimic specific, since
bluefs extents are not recorded in the superblock in later releases.

Signed-off-by: Josh Durgin <jdurgin@redhat.com>
5 years agosrc/osd/: Move session variables out of if for backport 29859/head
Samuel Just [Wed, 21 Aug 2019 22:06:43 +0000 (15:06 -0700)]
src/osd/: Move session variables out of if for backport

That construction isn't allowed in luminous.

Signed-off-by: Samuel Just <sjust@redhat.com>
5 years agomds,osd,mon,msg: use intrusive_ptr for holding Connection::priv
Kefu Chai [Tue, 29 May 2018 07:51:07 +0000 (15:51 +0800)]
mds,osd,mon,msg: use intrusive_ptr for holding Connection::priv

See-also: http://tracker.ceph.com/issues/20924
Signed-off-by: Kefu Chai <kchai@redhat.com>
Signed-off-by: Samuel Just <sjust@redhat.com>
(cherry picked from commit 72883956c26fdc4345324e9b27b45c3dfac17fa2)

 Conflicts:
src/osd/OSD.cc
src/osdc/Objecter.cc

5 years agoMerge pull request #27551 from smithfarm/wip-osd-markdown-luminous
Gregory Farnum [Wed, 21 Aug 2019 21:08:13 +0000 (14:08 -0700)]
Merge pull request #27551 from smithfarm/wip-osd-markdown-luminous

luminous: qa/standalone/osd/osd-markdown: fix dup command disabling

5 years agoosdc: cleanup code.
Jianpeng Ma [Mon, 9 Apr 2018 00:44:29 +0000 (08:44 +0800)]
osdc: cleanup code.

Remvoe useless conditon.

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
(cherry picked from commit 964068ca8f60a9409abbfdd5836eb89a29553229)

5 years agoosdc/Objecter: using session::put() rather than put_session().
Jianpeng Ma [Mon, 23 Oct 2017 13:55:13 +0000 (21:55 +0800)]
osdc/Objecter: using session::put() rather than put_session().

If using connection::get_priv(), it use session::put rather than
put_session() to reduce reduanant check.

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
(cherry picked from commit d485b1bf34e9e6bc7bc189a97f1b86718c5f0da5)

5 years agoMerge pull request #27471 from dzafman/wip-38567
Gregory Farnum [Wed, 21 Aug 2019 21:00:12 +0000 (14:00 -0700)]
Merge pull request #27471 from dzafman/wip-38567

luminous: doc: osd_recovery_priority is not documented (but osd_recovery_op_priority is)

5 years agomgr/DaemonServer: [Cleanup] Remove redundant code
Shinobu Kinjo [Sat, 4 Nov 2017 00:53:31 +0000 (09:53 +0900)]
mgr/DaemonServer: [Cleanup] Remove redundant code

Signed-off-by: Shinobu Kinjo <shinobu@redhat.com>
(cherry picked from commit e1b4c9de677a9041ba9dfba37d1b37999842789a)

5 years agoceph-volume: fix batch functional tests, idempotent test must check stderr 29791/head
Jan Fajerski [Thu, 15 Aug 2019 11:28:42 +0000 (13:28 +0200)]
ceph-volume: fix batch functional tests, idempotent test must check stderr

Fixes: https://tracker.ceph.com/issues/41295
Signed-off-by: Jan Fajerski <jfajerski@suse.com>
(cherry picked from commit 88807110f3014e7a2a39c37ae5c64bb3ab107d80)

 Conflicts:
src/ceph-volume/ceph_volume/tests/functional/batch/playbooks/test_explicit.yml
        removed

5 years agoos/bluestore: try to gift large extents, then fall back to small extents 29740/head
Sage Weil [Mon, 19 Aug 2019 15:09:36 +0000 (10:09 -0500)]
os/bluestore: try to gift large extents, then fall back to small extents

First try to gift using the larger alloc_size (normally bluefs_alloc_size,
but here max(bluefs_alloc_size,bluefs_shared_alloc_size) just in case the
settings are weird.  If that fails, then try the shared_alloc_size.  If
that fails, fail and complain as before, with an more accurate error
message.

Signed-off-by: Sage Weil <sage@redhat.com>
5 years agoos/bluestore: gift freespace to bluefs based on shared_alloc_size
Sage Weil [Mon, 19 Aug 2019 13:47:40 +0000 (08:47 -0500)]
os/bluestore: gift freespace to bluefs based on shared_alloc_size

This does not appear in master because this code was removed with the
allocator fallback behavior, which was not backported.

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 98c04c48c318ea15fdcbb331f879d9a962243559)

5 years agoos/bluestore/BlueFS: apply shared_alloc_size to shared device
Sage Weil [Mon, 19 Aug 2019 13:46:09 +0000 (08:46 -0500)]
os/bluestore/BlueFS: apply shared_alloc_size to shared device

Keep an alloc_size vector so that we have this value handy at all times.
Allow bluestore to fetch this value directly instead of looking at the
bluefs_* config options since this encapsulates things a bit better, and
also isn't vulnerable to the config setting changing at runtime.

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit e8b5a458c306dfe166b09239fc9f57c04fa47ead)

# Conflicts:
# src/os/bluestore/BlueFS.cc
- missing assert(got != 0) in luminous
- ROUND_UP_TO vs round_up_to
- missing fallback allocations
- no BDEV_NEW*
# src/os/bluestore/BlueFS.h
- adjacent declarations
# src/os/bluestore/BlueStore.cc
- P2ROUNDUP vs p2roundup

5 years agoos/bluestore/BlueFS: add bluefs_shared_alloc_size
Sage Weil [Wed, 7 Aug 2019 15:44:38 +0000 (10:44 -0500)]
os/bluestore/BlueFS: add bluefs_shared_alloc_size

Add a separate config option that controls the alloc_size for the shared
device (BDEV_SLOW).

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit c69c9539f628c61a1cf4cae6aadd39cb48a8b022)

- no Option::TYPE_SIZE

5 years agoos/bluestore: cleanup around allocator calls
Sage Weil [Fri, 16 Aug 2019 21:44:57 +0000 (16:44 -0500)]
os/bluestore: cleanup around allocator calls

Both stupid and bitmap allocator returs -ENOSPC if they're
unable to allocate any space. Existing callers aren't always
respect this - hence doing some cleanup.

Signed-off-by: Igor Fedotov <ifedotov@suse.com>
(cherry picked from commit a1246da5705e2a699656c2561cebc5ed29628c90)

- allocator fallback not there
- allocator fallback not there

5 years agorpm: always build ceph-test package 29736/head
Nathan Cutler [Thu, 15 Aug 2019 11:28:51 +0000 (13:28 +0200)]
rpm: always build ceph-test package

Fixes: https://tracker.ceph.com/issues/41296
Signed-off-by: Nathan Cutler <ncutler@suse.com>
(cherry picked from commit b9c744301051aa637f948be074be7b53c26cb504)

5 years agoMerge pull request #29603 from jan--f/wip-41202-luminous
Alfredo Deza [Tue, 13 Aug 2019 12:05:02 +0000 (08:05 -0400)]
Merge pull request #29603 from jan--f/wip-41202-luminous

luminous: ceph-volume prints log messages to stdout

Reviewed-by: Alfredo Deza <adeza@redhat.com>
5 years agoceph-volume: never log to stdout, use stderr instead 29603/head
Jan Fajerski [Thu, 8 Aug 2019 08:42:37 +0000 (10:42 +0200)]
ceph-volume: never log to stdout, use stderr instead

We should never print log messages to stdout, as this should be reserved
for output of ceph-volume.

Fixes: https://tracker.ceph.com/issues/41158
Signed-off-by: Jan Fajerski <jfajerski@suse.com>
(cherry picked from commit b8d6dcbe9f803c96c0af68da54f1262e9b6a9e77)

5 years agoceph-volume: terminal: encode unicode when writing to stdout
Kefu Chai [Sun, 24 Mar 2019 09:11:31 +0000 (17:11 +0800)]
ceph-volume: terminal: encode unicode when writing to stdout

python determins the encoding of stdout and stderr based on the LC_CTYPE
and PYTHONIOENCODING env variable, by default, python3's sys.stdout uses
'utf-8' as its encoding, so it will be able to write unicode string even
the stdout is not attached to a tty device. but when it comes to
python2, it will default to ascii if neither of these variabls is set.
so, if we are writing unicode using `_Write` in an environment where
LC_CTYPE and/or PYTHONIOENCODING are using non UTF-8 encoding, it chokes
by raising `UnicodeEncodeError` exception.

in this change, we add a wrapper around `_Write._writer` so it is able
to write unicode string in such a non-unicode-friendly environment.

for more info related the encoding of stdout and stderr, see
https://docs.python.org/3/using/cmdline.html#envvar-PYTHONIOENCODING .

Signed-off-by: Alfredo Deza <adeza@redhat.com>
Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 77912c0c71874a23785d3bdd109ad61e4f4c0e28)