Charm Interface - Ceph Client
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
OpenDev Sysadmins 8dd7042884 OpenDev Migration Patch 3 hours ago
unit_tests Merge "Revert "Refactor create_pool." and "Add request_access_to_group method"" 1 month ago
.gitignore Revert "Refactor create_pool." and "Add request_access_to_group method" 1 month ago
.gitreview OpenDev Migration Patch 3 hours ago
.project Add initial requires 1 year ago
.pydevproject Add initial requires 1 year ago
.testr.conf Add unit tests 4 months ago
.zuul.yaml Add unit tests 4 months ago
README.md Add initial requires 1 year ago
interface.yaml update interface.yaml with ignores and maintainer 1 month ago
provides.py do not need empty key 2 years ago
requires.py Merge "Revert "Refactor create_pool." and "Add request_access_to_group method"" 1 month ago
test-requirements.txt Add unit tests 4 months ago
tox.ini Add unit tests 4 months ago

README.md

Overview

This interface layer handles the communication between the Ceph Monitor cluster and a client that requires an access key and a pool to use.

Usage

Requires

This interface layer will set the following states, as appropriate:

  • {relation_name}.available The ceph client has been related to a provider.

The following accessors will be available:

  • key - The cephx access key
  • auth - Whether or not strict auth is supported
  • mon_hosts - The public addresses list of the monitor cluster

Client example:

@when('ceph-client.connected')
def ceph_connected(ceph_client):
  ceph_client.create_pool('newpool')

@when('ceph-client.available')
def ceph_ready(ceph_client):
  charm_ceph_conf= os.path.join(os.sep, 'etc', 'ceph', 'ceph.conf')
  cephx_key = os.path.join(os.sep, 'etc', 'ceph', 'ceph.client.charm.keyring')

  ceph_context = {
      'auth_supported': ceph_client.auth,
      'mon_hosts': ceph_client.mon_hosts,
  }

  with open(charm_ceph_conf, 'w') as cephconf:
    cephconf.write(render_template('ceph.conf', ceph_context))

  # Write out the cephx_key also
  with open(cephx_key, 'w') as cephconf:
    cephconf.write(ceph_client.key)