forked from p15670423/monkey
* Added the boto3 pckg to the right req'.txt file
* Added a safe dict key access for aws_instance_id in report.py * Added a skip in the aws_export if there is no instance_id in the issue.
This commit is contained in:
parent
e8c604d7c5
commit
2f1240cc0e
|
@ -26,6 +26,7 @@ class AWSExporter(Exporter):
|
|||
return True
|
||||
for machine in issues_list:
|
||||
for issue in issues_list[machine]:
|
||||
if not issue.get('aws_instance_id', None):
|
||||
findings_list.append(AWSExporter._prepare_finding(issue))
|
||||
|
||||
if not AWSExporter._send_findings(findings_list, AWSExporter._get_aws_keys()):
|
||||
|
|
|
@ -553,7 +553,7 @@ class ReportService:
|
|||
|
||||
@staticmethod
|
||||
def get_machine_aws_instance_id(hostname):
|
||||
return str(list(mongo.db.monkey.find({'hostname': hostname}, {'aws_instance_id': 1}))[0]['aws_instance_id'])
|
||||
return str(list(mongo.db.monkey.find({'hostname': hostname}, {'aws_instance_id': 1}))[0].get('aws_instance_id', None))
|
||||
|
||||
@staticmethod
|
||||
def get_issues():
|
||||
|
|
|
@ -14,4 +14,5 @@ netifaces
|
|||
ipaddress
|
||||
enum34
|
||||
PyCrypto
|
||||
boto3
|
||||
virtualenv
|
Loading…
Reference in New Issue