greater granularity
This commit is contained in:
parent
99d3362417
commit
8ac4ff1e99
@ -150,19 +150,15 @@ class SimpleSystemManagerBackend(BaseBackend):
|
||||
'DocumentName': kwargs['DocumentName'],
|
||||
'Comment': kwargs.get('Comment'),
|
||||
'ExpiresAfter': expires_after.isoformat(),
|
||||
'Parameters': {
|
||||
'string': [
|
||||
'string',
|
||||
]
|
||||
},
|
||||
'Parameters': kwargs['Parameters'],
|
||||
'InstanceIds': kwargs['InstanceIds'],
|
||||
'Targets': kwargs.get('targets'),
|
||||
'RequestedDateTime': now.isoformat(),
|
||||
'Status': 'Success',
|
||||
'StatusDetails': 'string',
|
||||
'OutputS3Region': 'string',
|
||||
'OutputS3BucketName': 'string',
|
||||
'OutputS3KeyPrefix': 'string',
|
||||
'OutputS3Region': kwargs.get('OutputS3Region'),
|
||||
'OutputS3BucketName': kwargs.get('OutputS3BucketName'),
|
||||
'OutputS3KeyPrefix': kwargs.get('OutputS3KeyPrefix'),
|
||||
'MaxConcurrency': 'string',
|
||||
'MaxErrors': 'string',
|
||||
'TargetCount': len(instances),
|
||||
|
@ -463,15 +463,27 @@ def test_add_remove_list_tags_for_resource():
|
||||
@mock_ssm
|
||||
def test_send_command():
|
||||
ssm_document = 'AWS-RunShellScript'
|
||||
script = '#!/bin/bash\necho \'hello world\''
|
||||
params = {'commands': ['#!/bin/bash\necho \'hello world\'']}
|
||||
|
||||
client = boto3.client('ssm', region_name='us-east-1')
|
||||
before = datetime.datetime.now()
|
||||
response = client.send_command(
|
||||
InstanceIds=['i-123456'],
|
||||
DocumentName=ssm_document,
|
||||
TimeoutSeconds=60,
|
||||
Parameters={'commands': [script]},
|
||||
OutputS3BucketName='the-bucket'
|
||||
Parameters=params,
|
||||
OutputS3Region='us-east-2',
|
||||
OutputS3BucketName='the-bucket',
|
||||
OutputS3KeyPrefix='pref'
|
||||
)
|
||||
cmd = response['Command']
|
||||
|
||||
assert response['Command']
|
||||
cmd['CommandId'].should_not.be(None)
|
||||
cmd['DocumentName'].should.equal(ssm_document)
|
||||
cmd['Parameters'].should.equal(params)
|
||||
|
||||
cmd['OutputS3Region'].should.equal('us-east-2')
|
||||
cmd['OutputS3BucketName'].should.equal('the-bucket')
|
||||
cmd['OutputS3KeyPrefix'].should.equal('pref')
|
||||
|
||||
cmd['ExpiresAfter'].should.be.greater_than(before)
|
||||
|
Loading…
Reference in New Issue
Block a user