Code Review
/
yardstick.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Add API to upload pod.yaml file
[yardstick.git]
/
api
/
base.py
diff --git
a/api/base.py
b/api/base.py
index
7671527
..
6fa2777
100644
(file)
--- a/
api/base.py
+++ b/
api/base.py
@@
-6,6
+6,7
@@
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
+from __future__ import absolute_import
import re
import importlib
import logging
import re
import importlib
import logging
@@
-22,9
+23,16
@@
logger.setLevel(logging.DEBUG)
class ApiResource(Resource):
def _post_args(self):
class ApiResource(Resource):
def _post_args(self):
- params = common_utils.translate_to_str(request.json)
- action = params.get('action', '')
+ data = request.json if request.json else {}
+ params = common_utils.translate_to_str(data)
+ action = params.get('action', request.form.get('action', ''))
args = params.get('args', {})
args = params.get('args', {})
+
+ try:
+ args['file'] = request.files['file']
+ except KeyError:
+ pass
+
logger.debug('Input args is: action: %s, args: %s', action, args)
return action, args
logger.debug('Input args is: action: %s, args: %s', action, args)
return action, args