Skip to content

Commit

Permalink
shrink-osd: check osd id format
Browse files Browse the repository at this point in the history
This adds a check early in order to ensure the format of osd ids passed
is correct.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2005734

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 968891f)
(cherry picked from commit 3f4abb0)
  • Loading branch information
guits committed Nov 10, 2021
1 parent 54d9643 commit bf8b35c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions infrastructure-playbooks/shrink-osd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@
-e osd_to_kill=0,1,2,3 argument."
when: osd_to_kill is not defined

- name: check the osd ids passed have the correct format
fail:
msg: "The id {{ item }} has wrong format, please pass the number only"
with_items: "{{ osd_to_kill.split(',') }}"
when: not item is regex("^\d$")

tasks:
- import_role:
name: ceph-defaults
Expand Down

0 comments on commit bf8b35c

Please sign in to comment.