SSM: Fix bad state caused by invalid PutParameter request (#6484)
This commit is contained in:
parent
47bca5b607
commit
89f2a3c538
@ -2062,7 +2062,11 @@ class SimpleSystemManagerBackend(BaseBackend):
|
|||||||
"formed as a mix of letters, numbers and the following 3 symbols .-_"
|
"formed as a mix of letters, numbers and the following 3 symbols .-_"
|
||||||
)
|
)
|
||||||
raise ValidationException(invalid_prefix_error)
|
raise ValidationException(invalid_prefix_error)
|
||||||
if not parameter_type and not overwrite and not self._parameters[name]:
|
if (
|
||||||
|
not parameter_type
|
||||||
|
and not overwrite
|
||||||
|
and not (name in self._parameters and self._parameters[name])
|
||||||
|
):
|
||||||
raise ValidationException(
|
raise ValidationException(
|
||||||
"A parameter type is required when you create a parameter."
|
"A parameter type is required when you create a parameter."
|
||||||
)
|
)
|
||||||
|
@ -448,6 +448,9 @@ def test_put_parameter_no_type():
|
|||||||
== "A parameter type is required when you create a parameter."
|
== "A parameter type is required when you create a parameter."
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Ensure backend state is consistent
|
||||||
|
assert client.describe_parameters()
|
||||||
|
|
||||||
|
|
||||||
@mock_ssm
|
@mock_ssm
|
||||||
def test_update_parameter():
|
def test_update_parameter():
|
||||||
|
Loading…
Reference in New Issue
Block a user