@@ -33,17 +33,7 @@ defmodule RabbitMQ.CLI.Queues.Commands.GrowCommand do
33
33
{ :validation_failure , :too_many_args }
34
34
end
35
35
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 ] , _ )
47
37
when not ( s == "all" or
48
38
s == "even" ) do
49
39
{ :validation_failure , "strategy '#{ s } ' is not recognised." }
@@ -56,23 +46,15 @@ defmodule RabbitMQ.CLI.Queues.Commands.GrowCommand do
56
46
{ :validation_failure , "voter status '#{ m } ' is not recognised." }
57
47
end
58
48
59
- def do_validate ( _ , _ ) do
49
+ def validate ( _ , _ ) do
60
50
:ok
61
51
end
62
52
63
53
def validate_execution_environment ( args , opts ) do
64
54
Validators . chain (
65
55
[
66
56
& 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
76
58
] ,
77
59
[ args , opts ]
78
60
)
@@ -85,7 +67,6 @@ defmodule RabbitMQ.CLI.Queues.Commands.GrowCommand do
85
67
membership: membership ,
86
68
errors_only: errors_only
87
69
} ) do
88
-
89
70
args = [ to_atom ( node ) , vhost_pat , queue_pat , to_atom ( strategy ) ]
90
71
91
72
args =
@@ -155,14 +136,8 @@ defmodule RabbitMQ.CLI.Queues.Commands.GrowCommand do
155
136
do:
156
137
"Grows quorum queue clusters by adding a member (replica) on the specified node for all matching queues"
157
138
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 } ..."
166
141
end
167
142
168
143
#
0 commit comments