From 34a4dcc0ecb6853b816f398d381e03f1ccba098b Mon Sep 17 00:00:00 2001 From: Frode Nordahl Date: Wed, 20 Feb 2019 07:34:45 +0100 Subject: [PATCH] Set appropriate application tag for pools created Use cases are emerging for the Ceph pool application tags. Let's set appropriate name for the pools created for CephFS. Change-Id: Iea36466f5038136727b7a6b62578cb3d0f964a6e Reference: http://docs.ceph.com/docs/master/rados/operations/pools/#associate-pool-to-application --- .gitignore | 2 ++ requires.py | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 3a6afa9..43c0315 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ *.swp .testrepository .tox +__pycache__ +.stestr diff --git a/requires.py b/requires.py index 492b00a..f51e157 100644 --- a/requires.py +++ b/requires.py @@ -19,6 +19,7 @@ class CephClient(RelationBase): scope = scopes.GLOBAL auto_accessors = ['mds_key', 'fsid', 'auth'] + ceph_pool_app_name = 'cephfs' @hook('{requires:ceph-mds}-relation-{joined}') def joined(self): @@ -71,10 +72,12 @@ class CephClient(RelationBase): rq = CephBrokerRq() rq.add_op_create_pool(name="{}_data".format(name), replica_count=replicas, - weight=None) + weight=None, + app_name=self.ceph_pool_app_name) rq.add_op_create_pool(name="{}_metadata".format(name), replica_count=replicas, - weight=None) + weight=None, + app_name=self.ceph_pool_app_name) # Create CephFS rq.ops.append({ 'op': 'create-cephfs',