get_parameters should list InvalidParameters
Signed-off-by: Ali Rizwan <ari@hellofresh.com>
This commit is contained in:
parent
0b8cf14706
commit
1c96335895
@ -57,6 +57,10 @@ class SimpleSystemManagerResponse(BaseResponse):
|
|||||||
param_data = parameter.response_object(with_decryption)
|
param_data = parameter.response_object(with_decryption)
|
||||||
response['Parameters'].append(param_data)
|
response['Parameters'].append(param_data)
|
||||||
|
|
||||||
|
param_names = [param.name for param in result]
|
||||||
|
for name in names:
|
||||||
|
if name not in param_names:
|
||||||
|
response['InvalidParameters'].append(name)
|
||||||
return json.dumps(response)
|
return json.dumps(response)
|
||||||
|
|
||||||
def describe_parameters(self):
|
def describe_parameters(self):
|
||||||
|
@ -161,7 +161,6 @@ def test_describe_parameters_filter_type():
|
|||||||
p['KeyId'] = 'a key'
|
p['KeyId'] = 'a key'
|
||||||
client.put_parameter(**p)
|
client.put_parameter(**p)
|
||||||
|
|
||||||
|
|
||||||
response = client.describe_parameters(Filters=[
|
response = client.describe_parameters(Filters=[
|
||||||
{
|
{
|
||||||
'Key': 'Type',
|
'Key': 'Type',
|
||||||
@ -188,7 +187,6 @@ def test_describe_parameters_filter_keyid():
|
|||||||
p['KeyId'] = "key:%d" % i
|
p['KeyId'] = "key:%d" % i
|
||||||
client.put_parameter(**p)
|
client.put_parameter(**p)
|
||||||
|
|
||||||
|
|
||||||
response = client.describe_parameters(Filters=[
|
response = client.describe_parameters(Filters=[
|
||||||
{
|
{
|
||||||
'Key': 'KeyId',
|
'Key': 'KeyId',
|
||||||
@ -201,6 +199,20 @@ def test_describe_parameters_filter_keyid():
|
|||||||
''.should.equal(response.get('NextToken', ''))
|
''.should.equal(response.get('NextToken', ''))
|
||||||
|
|
||||||
|
|
||||||
|
@mock_ssm
|
||||||
|
def test_get_parameter_invalid():
|
||||||
|
client = client = boto3.client('ssm', region_name='us-east-1')
|
||||||
|
response = client.get_parameters(
|
||||||
|
Names=[
|
||||||
|
'invalid'
|
||||||
|
],
|
||||||
|
WithDecryption=False)
|
||||||
|
|
||||||
|
len(response['Parameters']).should.equal(0)
|
||||||
|
len(response['InvalidParameters']).should.equal(1)
|
||||||
|
response['InvalidParameters'][0].should.equal('invalid')
|
||||||
|
|
||||||
|
|
||||||
@mock_ssm
|
@mock_ssm
|
||||||
def test_put_parameter_secure_default_kms():
|
def test_put_parameter_secure_default_kms():
|
||||||
client = boto3.client('ssm', region_name='us-east-1')
|
client = boto3.client('ssm', region_name='us-east-1')
|
||||||
|
Loading…
Reference in New Issue
Block a user