예제 #1
0
def audit_elb(accounts, send_report):
    """ Runs auditors/elb """
    accounts = __prep_accounts__(accounts)
    au = ELBAuditor(accounts=accounts, debug=True)
    au.audit_all_objects()

    if send_report:
        report = au.create_report()
        au.email_report(report)

    au.save_issues()
    db.session.close()
예제 #2
0
def find_elb_changes(accounts):
    """ Runs watchers/elb"""
    accounts = __prep_accounts__(accounts)
    cw = ELB(accounts=accounts, debug=True)
    (items, exception_map) = cw.slurp()
    cw.find_changes(current=items, exception_map=exception_map)

    # Audit these changed items
    items_to_audit = []
    for item in cw.created_items + cw.changed_items:
        elb_item = ELBItem(region=item.region, account=item.account, name=item.name, config=item.new_config)
        items_to_audit.append(elb_item)

    au = ELBAuditor(accounts=accounts, debug=True)
    au.audit_these_objects(items_to_audit)
    au.save_issues()
    cw.save()
    db.session.close()