]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
library/ceph_pool: Fix potential null value when creating pools
authorMathias Chapelain <mathias.chapelain@proton.ch>
Fri, 11 Feb 2022 14:11:22 +0000 (15:11 +0100)
committerGuillaume Abrioux <gabrioux@redhat.com>
Mon, 4 Apr 2022 07:33:23 +0000 (09:33 +0200)
Before, creating a pool by providing *only* `pg_num` would result in an
error as it would produce `--pgp-num null`.

This commit fix this behavior by defaulting `pgp_num` value to `pg_num`.

Signed-off-by: Mathias Chapelain <mathias.chapelain@proton.ch>
(cherry picked from commit f0f1dd986aab8b32fad55a8885faf5ed7ef66e06)

library/ceph_pool.py

index d3dc12a8a9f8c5e9256002f15ea159a91ecba00a..6f92119370e28c51f8718042e6b096bcb65d8dfa 100644 (file)
@@ -395,7 +395,8 @@ def create_pool(cluster,
         args.extend(['--pg_num',
                      user_pool_config['pg_num']['value'],
                      '--pgp_num',
-                     user_pool_config['pgp_num']['value']])
+                     user_pool_config['pgp_num']['value'] or
+                     user_pool_config['pg_num']['value']])
     elif user_pool_config['target_size_ratio']['value']:
         args.extend(['--target_size_ratio',
                      user_pool_config['target_size_ratio']['value']])