Fix deprecation warning by validate_legacy

Currently the swift::storage::node defined type shows the warning
message below, followed by huge call trace log, when zone parameter is
set by a string value.

~~~
Warning: validate_legacy(validate_re) expects an Integer value, got
String at ...
~~~

This change fixes usage of the validate_legacy function to avoid
that warning.

Change-Id: Ic9ca9fb952e4a678deeb1b8e04c09ba620b8ae20
(cherry picked from commit 4be2336843)
This commit is contained in:
Takashi Kajinami
2022-07-08 14:14:57 +09:00
parent 2d1b0a7f8a
commit afa7e2b426

View File

@@ -54,8 +54,10 @@ define swift::storage::node(
include swift::deps
validate_legacy(Integer, 'validate_re', $zone,
if ! $zone =~ Integer {
validate_legacy(Pattern[/^\d+$/], 'validate_re', $zone,
['^\d+$', 'The zone parameter must be an integer'])
}
Swift::Storage::Server {
storage_local_net_ip => $storage_local_net_ip,