I used ValueError for both exception.
Also removed unnecessary flake8 ignore option.
Closes-Bug: #1917351
Change-Id: I5ee58aa0a34d7c266b3811f9c6b9b3076bfdc048
The new python3-ceph-common deb package (introduced in ceph octopus)
adds a new ceph directory (a parent package in python terms) in
/usr/lib/python3/dist-packages/ceph/. This results in a conflict with
charm-ceph-xyz/lib/ceph/ on imports. For example, with the current
import of ceph.utils in ceph-osd/hooks/ceph_hooks.py, Python finds no
utils.py in /usr/lib/python3/dist-packages/ceph/ and then stops
searching. Therefore, rename ceph to charms_ceph to avoid the
conflict.
Change-Id: I6eaf03e291f65125269b1836dd2636806f9945e1
For Nautilus the Ceph monitors automatically create the admin and
bootstrap keyrings as part of cluster formation so the charm just
needs to retrieve the admin keyring after the monitors have been
bootstrapped.
As the bootstrap process is two quite distinct steps, this change
refactors the bootstrap_monitor_cluster function into two discrete
functions - one to create and start the ceph monitor, and a second
to create the ceph keyrings on the local filesystem.
As the osd-bootstrap keyring is not actually created on disk from
Nautilus onwards, the 'is_bootstrapped' function now looks for the
client.admin keyring across all Ceph releases - this should be
backwards compatible.
This change also adds the standing data for upgrade paths to
Nautilus, however this is as yet untested.
Change-Id: I2dfab7404b72e314625ea554ee64595c5e26f3c6
tox: Remove cleanup of Python object files as this breaks
in the upstream gate.
tox: While at it migrate from os-testr to stestr.
Change-Id: I1bad5311ed034188a78dc67b493c22bff7ce4f7d
We want to default to running all tox environments under python 3, so
set the basepython value in each environment.
We do not want to specify a minor version number, because we do not
want to have to update the file every time we upgrade python.
We do not want to set the override once in testenv, because that
breaks the more specific versions used in default environments like
py35 and py36.
Change-Id: I63830ec00763aa522934f555b1d90b409df6e147
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
Unit tests should run with hash seed randomization
on, to ensure code is not introduced that relies on
ordered access of dicts, sets, etc.
Python 3.3 enables this at runtime by default.
Change-Id: I792cf9d24867b0bb8c9c43030ed80d5fd6ce6ec0
As a part of the mitigation of LP Bug #1698154 remove the reformat
option and initialization of journal devices entirely. Ceph charms
can rely on actions to have operator administratively execute
zap_disk.
There should not be a code path that could accidentally execute
zap_disk without administrative intervention.
Make py27 test noop
Flip pep8 test to py3
Partial-Bug: #1698154
Change-Id: I90a866aa138d18e4242783c42d4c7c587f696d7d
Add support for propagation of key manager configuration from
calling charms into OSD preparation codepaths; this is used
predominately in the 'vault' key management approach where
the block device is encrypted outside of ceph-volume/ceph-disk
vs the 'ceph' key management approach where ceph tools take
responsibility for management of the keys lower down the stack.
The 'vault' key management approach is integrated in the
_initialize_disk function - if vault is selected as the key
manager, then vaultlocker is used to encrypt and open the disk;
the resulting /dev/mapper/crypt-<UUID> device is then used
for LVM, rather than the underlying partition.
Change-Id: If73e7bd518a7bc60c2db08e2aa3a93dcfe79c0dd
These changes make the charms.ceph library suitable for both the
old-stable Python 2 charms and the (to be) updates Python 3 only charms.
Avoided use of six by using str() with the decode('UTF-8') function to
allow the library to be used with both Py2 and Py3. The str(...)
coercions can be removed at a later date when the library no longer
needs to be synced to Py2 versions of the ceph-* charms.
Change-Id: I416053439444bf4cf8945d1fe96643f9ed0f05f4
We want to allow the user to use additional block
devices as bluestore Write Ahead Log
or bluestore RocksDB storage
Closes-Bug: #1710474
Change-Id: I4d5a03a340b88959f9d36864244fd42060302a15
Ceph Luminos removes the automatic call to ceph-create-keys on
ceph-mon startup; deployment tools are required to call this
after the monitors have been started to create the admin keyring
across the cluster.
ceph-create-keys still blocks until the cluster is in quorum, at
which points keys are created and written out to the normal location
in /etc/ceph.
Change-Id: Ifc9b8aaf3dbce71cb62567ba03455d2196eaf29f
Commit 195d002ab added a setup.py to the charms.ceph library for
inclusion in the pypi repositories. The setup.py file included was
not lint checked and introduces pep8 violations which are checked
in dependent projects (charm-ceph-osd, charm-ceph-mon, etc).
This change fixes the pep8 linting and also adds the setup.py file
to the tox configuration file to prevent future issues.
Change-Id: Ic84d3348023e8fa968638be935af9b5d31806ef1
charms.ceph is not currently installable using pip; add required
setup.py file to ensure it can be consumed in this way.
Change-Id: Ife1828213d01eed541153089eef0b93efb941a57
This patch adds a list of pool support into the
get_named_key
function to allow callers to specify the pools the cephx key
should have access to. This patch also adds in tox testing.