@@ -33,17 +33,7 @@ defmodule RabbitMQ.CLI.Queues.Commands.GrowCommand do
3333 { :validation_failure , :too_many_args }
3434 end
3535
36- def validate ( args = [ n , s ] , opts ) do
37- case Integer . parse ( n ) do
38- { cluster_size , _ } when is_integer ( cluster_size ) ->
39- do_validate ( [ cluster_size , s ] , opts )
40-
41- :error ->
42- do_validate ( args , opts )
43- end
44- end
45-
46- def do_validate ( [ _ , s ] , _ )
36+ def validate ( [ _ , s ] , _ )
4737 when not ( s == "all" or
4838 s == "even" ) do
4939 { :validation_failure , "strategy '#{ s } ' is not recognised." }
@@ -56,23 +46,15 @@ defmodule RabbitMQ.CLI.Queues.Commands.GrowCommand do
5646 { :validation_failure , "voter status '#{ m } ' is not recognised." }
5747 end
5848
59- def do_validate ( _ , _ ) do
49+ def validate ( _ , _ ) do
6050 :ok
6151 end
6252
6353 def validate_execution_environment ( args , opts ) do
6454 Validators . chain (
6555 [
6656 & Validators . rabbit_is_running / 2 ,
67- fn args = [ n , _ ] , opts ->
68- case Integer . parse ( n ) do
69- { cluster_size , _ } when is_integer ( cluster_size ) ->
70- :ok
71-
72- :error ->
73- Validators . existing_cluster_member ( args , opts )
74- end
75- end
57+ & Validators . existing_cluster_member / 2
7658 ] ,
7759 [ args , opts ]
7860 )
@@ -85,7 +67,6 @@ defmodule RabbitMQ.CLI.Queues.Commands.GrowCommand do
8567 membership: membership ,
8668 errors_only: errors_only
8769 } ) do
88-
8970 args = [ to_atom ( node ) , vhost_pat , queue_pat , to_atom ( strategy ) ]
9071
9172 args =
@@ -155,14 +136,8 @@ defmodule RabbitMQ.CLI.Queues.Commands.GrowCommand do
155136 do:
156137 "Grows quorum queue clusters by adding a member (replica) on the specified node for all matching queues"
157138
158- def banner ( [ node_or_quorum_cluster_size , strategy ] , % { queue_pattern: queue_pattern } ) do
159- case Integer . parse ( node_or_quorum_cluster_size ) do
160- { cluster_size , _ } when is_integer ( cluster_size ) ->
161- "Growing #{ strategy } quorum queues matching '#{ queue_pattern } ' to a target cluster size of '#{ cluster_size } '..."
162-
163- :error ->
164- "Growing #{ strategy } quorum queues matching '#{ queue_pattern } ' to #{ node_or_quorum_cluster_size } ..."
165- end
139+ def banner ( [ node , strategy ] , _ ) do
140+ "Growing #{ strategy } quorum queues on #{ node } ..."
166141 end
167142
168143 #
0 commit comments