Skip to content

Commit

Permalink
Revert back to master before serverless implementation.
Browse files Browse the repository at this point in the history
  • Loading branch information
chanchiem committed Feb 22, 2019
1 parent c8e8012 commit 033e03f
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 528 deletions.
4 changes: 0 additions & 4 deletions aws_xray_sdk/core/exceptions/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ class FacadeSegmentMutationException(Exception):
pass


class MimicSegmentInvalidException(Exception):
pass


class MissingPluginNames(Exception):
pass

Expand Down
51 changes: 0 additions & 51 deletions aws_xray_sdk/core/models/mimic_segment.py

This file was deleted.

3 changes: 1 addition & 2 deletions aws_xray_sdk/core/recorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,7 @@ def begin_segment(self, name=None, traceid=None,
self._populate_runtime_context(segment, decision)

self.context.put_segment(segment)
current_segment = self.get_trace_entity()
return current_segment
return segment

def end_segment(self, end_time=None):
"""
Expand Down
130 changes: 0 additions & 130 deletions aws_xray_sdk/core/serverless_lambda_context.py

This file was deleted.

9 changes: 0 additions & 9 deletions aws_xray_sdk/ext/django/middleware.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import logging

from aws_xray_sdk.core import xray_recorder
from aws_xray_sdk.core.lambda_launcher import check_in_lambda, LambdaContext
from aws_xray_sdk.core.models import http
from aws_xray_sdk.core.serverless_lambda_context import ServerlessLambdaContext
from aws_xray_sdk.core.utils import stacktrace
from aws_xray_sdk.ext.util import calculate_sampling_decision, \
calculate_segment_name, construct_xray_header, prepare_response_header
Expand All @@ -27,13 +25,6 @@ def __init__(self, get_response):

self.get_response = get_response

# The case when the middleware is initialized in a Lambda Context, we make sure
# to use the ServerlessLambdaContext so that the middleware properly functions.
# We also check if the current context is a LambdaContext to not override customer
# provided contexts.
if check_in_lambda() is not None and type(xray_recorder.context) == LambdaContext:
xray_recorder.context = ServerlessLambdaContext()

# hooks for django version >= 1.10
def __call__(self, request):

Expand Down
9 changes: 0 additions & 9 deletions aws_xray_sdk/ext/flask/middleware.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import flask.templating
from flask import request

from aws_xray_sdk.core.lambda_launcher import check_in_lambda, LambdaContext
from aws_xray_sdk.core.models import http
from aws_xray_sdk.core.serverless_lambda_context import ServerlessLambdaContext
from aws_xray_sdk.core.utils import stacktrace
from aws_xray_sdk.ext.util import calculate_sampling_decision, \
calculate_segment_name, construct_xray_header, prepare_response_header
Expand All @@ -20,13 +18,6 @@ def __init__(self, app, recorder):
self.app.after_request(self._after_request)
self.app.teardown_request(self._handle_exception)

# The case when the middleware is initialized in a Lambda Context, we make sure
# to use the ServerlessLambdaContext so that the middleware properly functions.
# We also check if the current context is a LambdaContext to not override customer
# provided contexts.
if check_in_lambda() is not None and type(self._recorder.context) == LambdaContext:
self._recorder.context = ServerlessLambdaContext()

_patch_render(recorder)

def _before_request(self):
Expand Down
127 changes: 0 additions & 127 deletions tests/test_mimic_segment.py

This file was deleted.

Loading

0 comments on commit 033e03f

Please sign in to comment.