Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #727 from mozilla/update_cloudtrail_plugin
Browse files Browse the repository at this point in the history
Add responseelements lastModified in cloudtrail plugin
  • Loading branch information
Phrozyn authored Jul 23, 2018
2 parents 5da4a88 + 9e05f32 commit c26229b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions mq/plugins/cloudtrail.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def __init__(self):
'details.responseelements.subnets',
'details.responseelements.endpoint',
'details.responseelements.securityGroups',
'details.responseelements.lastModified',
'details.additionaleventdata',
'details.serviceeventdetails',
'details.requestparameters.disableApiTermination',
Expand Down
24 changes: 24 additions & 0 deletions tests/mq/plugins/test_cloudtrail.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,30 @@ def test_disableApiTermination(self):
assert retmessage == expected_message
assert retmeta == {}

def test_responseelements_lastModified(self):
msg = {
'source': 'cloudtrail',
'details': {
'responseelements': {
'lastModified': 'astringvalue'
}
}
}
(retmessage, retmeta) = self.plugin.onMessage(msg, {})

expected_message = {
'source': 'cloudtrail',
'details': {
'responseelements': {
'lastModified': {
'raw_value': 'astringvalue'
}
}
}
}
assert retmessage == expected_message
assert retmeta == {}

def test_unusual(self):
msg = {
'source': 'cloudtrail',
Expand Down

0 comments on commit c26229b

Please sign in to comment.