Remove Swagger from Storperf 73/36273/2
authorShrenik <shrenik.jain@research.iiit.ac.in>
Tue, 20 Jun 2017 20:10:53 +0000 (01:40 +0530)
committerShrenik <shrenik.jain@research.iiit.ac.in>
Tue, 20 Jun 2017 21:11:26 +0000 (02:41 +0530)
Remove Swagger module from Storperf

Change-Id: Id491bb7ea1ddd55549d39ddbe4c7a7004d797a59
JIRA: STORPERF-129
Signed-off-by: Shrenik <shrenik.jain@research.iiit.ac.in>
docker/Dockerfile
rest_server.py

index d587fc4..f1ec617 100644 (file)
@@ -98,11 +98,6 @@ RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/storperf ${re
 RUN git clone --depth 1 https://gerrit.opnfv.org/gerrit/releng ${repos_dir}/releng
 
 # Third party git fetches
-RUN git clone https://github.com/swagger-api/swagger-ui.git ${repos_dir}/swagger-ui
-RUN cd ${repos_dir}/swagger-ui && git checkout tags/v2.2.9
-RUN mkdir -p ${repos_dir}/storperf/storperf/resources/html/swagger
-RUN cp -r ${repos_dir}/swagger-ui/dist/* ${repos_dir}/storperf/storperf/resources/html/swagger
-RUN sed -i 's|url = "http://petstore.swagger.io/v2/swagger.json";|url = window.location.protocol+"//"+window.location.host+"/api/spec.json";|' ${repos_dir}/storperf/storperf/resources/html/swagger/index.html
 
 RUN git clone http://git.kernel.dk/fio.git ${repos_dir}/fio
 RUN cd ${repos_dir}/fio && git checkout tags/fio-2.2.10
index 8dffb11..67d71a5 100644 (file)
 import json
 import logging.config
 import os
-from storperf.storperf_master import StorPerfMaster
 import sys
 
 from flask import abort, Flask, request, jsonify, send_from_directory
-from flask_cors import CORS, cross_origin
 from flask_restful import Resource, Api, fields
 from flask_restful_swagger import swagger
 
+from flask_cors import CORS
+from storperf.storperf_master import StorPerfMaster
+
 
 app = Flask(__name__, static_url_path="")
 CORS(app)
@@ -26,11 +27,6 @@ api = swagger.docs(Api(app), apiVersion='1.0')
 storperf = StorPerfMaster()
 
 
-@app.route('/swagger/<path:path>')
-def send_swagger(path):
-    return send_from_directory('storperf/resources/html/swagger', path)
-
-
 @swagger.model
 class ConfigurationRequestModel:
     resource_fields = {