greater granularity
This commit is contained in:
parent
99d3362417
commit
8ac4ff1e99
@ -150,19 +150,15 @@ class SimpleSystemManagerBackend(BaseBackend):
|
|||||||
'DocumentName': kwargs['DocumentName'],
|
'DocumentName': kwargs['DocumentName'],
|
||||||
'Comment': kwargs.get('Comment'),
|
'Comment': kwargs.get('Comment'),
|
||||||
'ExpiresAfter': expires_after.isoformat(),
|
'ExpiresAfter': expires_after.isoformat(),
|
||||||
'Parameters': {
|
'Parameters': kwargs['Parameters'],
|
||||||
'string': [
|
|
||||||
'string',
|
|
||||||
]
|
|
||||||
},
|
|
||||||
'InstanceIds': kwargs['InstanceIds'],
|
'InstanceIds': kwargs['InstanceIds'],
|
||||||
'Targets': kwargs.get('targets'),
|
'Targets': kwargs.get('targets'),
|
||||||
'RequestedDateTime': now.isoformat(),
|
'RequestedDateTime': now.isoformat(),
|
||||||
'Status': 'Success',
|
'Status': 'Success',
|
||||||
'StatusDetails': 'string',
|
'StatusDetails': 'string',
|
||||||
'OutputS3Region': 'string',
|
'OutputS3Region': kwargs.get('OutputS3Region'),
|
||||||
'OutputS3BucketName': 'string',
|
'OutputS3BucketName': kwargs.get('OutputS3BucketName'),
|
||||||
'OutputS3KeyPrefix': 'string',
|
'OutputS3KeyPrefix': kwargs.get('OutputS3KeyPrefix'),
|
||||||
'MaxConcurrency': 'string',
|
'MaxConcurrency': 'string',
|
||||||
'MaxErrors': 'string',
|
'MaxErrors': 'string',
|
||||||
'TargetCount': len(instances),
|
'TargetCount': len(instances),
|
||||||
|
@ -463,15 +463,27 @@ def test_add_remove_list_tags_for_resource():
|
|||||||
@mock_ssm
|
@mock_ssm
|
||||||
def test_send_command():
|
def test_send_command():
|
||||||
ssm_document = 'AWS-RunShellScript'
|
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')
|
client = boto3.client('ssm', region_name='us-east-1')
|
||||||
|
before = datetime.datetime.now()
|
||||||
response = client.send_command(
|
response = client.send_command(
|
||||||
InstanceIds=['i-123456'],
|
InstanceIds=['i-123456'],
|
||||||
DocumentName=ssm_document,
|
DocumentName=ssm_document,
|
||||||
TimeoutSeconds=60,
|
TimeoutSeconds=60,
|
||||||
Parameters={'commands': [script]},
|
Parameters=params,
|
||||||
OutputS3BucketName='the-bucket'
|
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