From 2cdc5f1f8b78f9d43d2b17426a1b460b60da6f77 Mon Sep 17 00:00:00 2001 From: Phrozyn Date: Mon, 17 Dec 2018 17:01:32 -0600 Subject: [PATCH] PEP 8 --- alerts/get_watchlist.py | 4 ++-- rest/index.py | 4 ++-- rest/plugins/watchlist.py | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/alerts/get_watchlist.py b/alerts/get_watchlist.py index 8c09db92..d292fdfe 100644 --- a/alerts/get_watchlist.py +++ b/alerts/get_watchlist.py @@ -7,7 +7,7 @@ from lib.alerttask import AlertTask -from mozdef_util.query_models import SearchQuery, PhraseMatch, TermsMatch, QueryStringMatch +from mozdef_util.query_models import SearchQuery, QueryStringMatch import requests import json import logging @@ -27,7 +27,7 @@ class AlertWatchList(AlertTask): jwt_token = JWTAuth(self.config.jwt_secret) jwt_token.set_header_format('Bearer %s') - #Connect to rest api and grab response + # Connect to rest api and grab response r = requests.get(self.config.api_url, auth=jwt_token) status = r.status_code index = 0 diff --git a/rest/index.py b/rest/index.py index 05c221b3..69334102 100644 --- a/rest/index.py +++ b/rest/index.py @@ -554,12 +554,12 @@ def getWatchlist(): watchlist = mozdefdb['watchlist'] # Log the entries we are removing to maintain an audit log - expired = watchlist.find({'dateExpiring': {"$lte": datetime.utcnow()-timedelta(hours=1)}}) + expired = watchlist.find({'dateExpiring': {"$lte": datetime.utcnow() - timedelta(hours=1)}}) for entry in expired: sys.stdout.write('Deleting entry {0} from watchlist /n'.format(entry)) # delete any that expired - watchlist.delete_many({'dateExpiring': {"$lte": datetime.utcnow()-timedelta(hours=1)}}) + watchlist.delete_many({'dateExpiring': {"$lte": datetime.utcnow() - timedelta(hours=1)}}) # Lastly, export the combined watchlist watchCursor=mozdefdb['watchlist'].aggregate([ diff --git a/rest/plugins/watchlist.py b/rest/plugins/watchlist.py index 9e1c0663..97c8197a 100644 --- a/rest/plugins/watchlist.py +++ b/rest/plugins/watchlist.py @@ -7,7 +7,6 @@ import os import random import requests import sys -import re from configlib import getConfig, OptionParser from datetime import datetime, timedelta from pymongo import MongoClient