Skip to content

Commit

Permalink
library/ceph_pool: Fix potential null value when creating pools
Browse files Browse the repository at this point in the history
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 <[email protected]>
(cherry picked from commit f0f1dd9)
  • Loading branch information
Papawy authored and guits committed Apr 13, 2022
1 parent df8674a commit 36248ed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion library/ceph_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,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']])
Expand Down

0 comments on commit 36248ed

Please sign in to comment.