Skip to content
Permalink
Browse files

Remove sys.path where possible from mq

  • Loading branch information...
pwnbus committed Aug 7, 2019
1 parent e79c290 commit 89374b3fe6b2b220de219725c9cd38f2c9a67318
@@ -27,10 +27,9 @@
from mozdef_util.utilities.to_unicode import toUnicode
from mozdef_util.utilities.remove_at import removeAt

sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../"))
from mq.lib.aws import get_aws_credentials
from mq.lib.plugins import sendEventToPlugins, registerPlugins
from mq.lib.sqs import connect_sqs
from lib.aws import get_aws_credentials
from lib.plugins import sendEventToPlugins, registerPlugins
from lib.sqs import connect_sqs


CLOUDTRAIL_VERB_REGEX = re.compile(r'^([A-Z][^A-Z]*)')
@@ -9,7 +9,6 @@
import json
import kombu
import sys
import os
import socket
from configlib import getConfig, OptionParser
from datetime import datetime
@@ -23,8 +22,7 @@
from mozdef_util.utilities.to_unicode import toUnicode
from mozdef_util.utilities.remove_at import removeAt

sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../"))
from mq.lib.plugins import sendEventToPlugins, registerPlugins
from lib.plugins import sendEventToPlugins, registerPlugins


# running under uwsgi?
@@ -12,7 +12,6 @@
import json
import kombu
import sys
import os
import socket
import time
from configlib import getConfig, OptionParser
@@ -27,8 +26,7 @@
from mozdef_util.utilities.remove_at import removeAt
from mozdef_util.utilities.logger import logger, initLogger

sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../"))
from mq.lib.plugins import sendEventToPlugins, registerPlugins
from lib.plugins import sendEventToPlugins, registerPlugins


# running under uwsgi?
@@ -9,7 +9,6 @@
import json

import sys
import os
import socket
import time
from configlib import getConfig, OptionParser
@@ -23,9 +22,8 @@
from mozdef_util.utilities.logger import logger, initLogger
from mozdef_util.elasticsearch_client import ElasticsearchClient, ElasticsearchBadServer, ElasticsearchInvalidIndex, ElasticsearchException

sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../"))
from mq.lib.plugins import sendEventToPlugins, registerPlugins
from mq.lib.sqs import connect_sqs
from lib.plugins import sendEventToPlugins, registerPlugins
from lib.sqs import connect_sqs


# running under uwsgi?
@@ -13,7 +13,6 @@

import json
import sys
import os
import socket
import time
from configlib import getConfig, OptionParser
@@ -28,9 +27,8 @@
from mozdef_util.utilities.logger import logger, initLogger
from mozdef_util.elasticsearch_client import ElasticsearchClient, ElasticsearchBadServer, ElasticsearchInvalidIndex, ElasticsearchException

sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../"))
from mq.lib.plugins import sendEventToPlugins, registerPlugins
from mq.lib.sqs import connect_sqs
from lib.plugins import sendEventToPlugins, registerPlugins
from lib.sqs import connect_sqs


# running under uwsgi?
No changes.
@@ -7,16 +7,15 @@

import json

from mozdef_util.utilities.dot_dict import DotDict
from mozdef_util.query_models import SearchQuery, ExistsMatch

import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), "../../mq"))
from mq.esworker_sns_sqs import taskConsumer

from mozdef_util.utilities.dot_dict import DotDict
from mozdef_util.query_models import SearchQuery, ExistsMatch

sys.path.append(os.path.join(os.path.dirname(__file__), "../"))
from unit_test_suite import UnitTestSuite
from tests.unit_test_suite import UnitTestSuite


class TestEsworkerSNSSQS(UnitTestSuite):

0 comments on commit 89374b3

Please sign in to comment.
You can’t perform that action at this time.