diff --git a/Dockerfile b/Dockerfile index ff783f7..fbae532 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ozregistry.azurecr.io/ozone-public-registry/ozoneprod/python:3.8-slim-buster +FROM blrdbharbor.ozonecloud.ai/ozone-public-registry/ozoneprod/python:3.8-slim-buster WORKDIR /app COPY . . RUN pip3 install -U pip diff --git a/main.py b/main.py index 9dea202..768bc7f 100644 --- a/main.py +++ b/main.py @@ -11,43 +11,21 @@ @newrelic.agent.wsgi_application() @app.route('/', methods=['GET', 'POST']) def index(): - n = random.random() - if n > 0.95: - raise Exception("unknown exception occured") - newrelic.agent.notice_error() - return Response( - response=json.dumps({'error': "unknown exception happened"}), - mimetype='application/json', - status=500 - ) - else: - print("success") - return Response( - response=json.dumps({'value': 11}), - mimetype='application/json' - ) + return Response( + response=json.dumps({"welcome": "to ozone onboarding", 'value': "ozone-python-hello-world application"}), + mimetype='application/json' + ) @newrelic.agent.wsgi_application() @app.route('/hello', methods=['GET', 'POST']) def hello(): - n = random.random() - if n > 0.98: - raise Exception("unknown exception occured") - print("unknown exception occured") - newrelic.agent.notice_error() - return Response( - response=json.dumps({'error': "unknown exception happened"}), - mimetype='application/json', - status=500 - ) - else: - print("success") - return Response( - response=json.dumps( - {"route": "/hello", "response": "hello world main branch"}), - mimetype='application/json' - ) + print("success") + return Response( + response=json.dumps( + {"route": "/hello", "response": "hello world main branch"}), + mimetype='application/json' + ) if __name__ == "__main__":