library/ceph_pool: Fix potential null value when creating pools

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>
pull/7090/head
Mathias Chapelain 2022-02-11 15:11:22 +01:00 committed by Guillaume Abrioux
parent 94e51d5c14
commit f0f1dd986a
1 changed files with 2 additions and 1 deletions

View 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']])